From ee732fb2235fbe242d75366fc37d3f53e2082519 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 3 Feb 2022 12:43:14 +0200 Subject: [PATCH] handle wif format private keys with uncompressed pubkeys --- .../java/com/sparrowwallet/drongo/crypto/DumpedPrivateKey.java | 2 +- .../com/sparrowwallet/drongo/protocol/TransactionSignature.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/crypto/DumpedPrivateKey.java b/src/main/java/com/sparrowwallet/drongo/crypto/DumpedPrivateKey.java index 52abd86..8fac3ce 100644 --- a/src/main/java/com/sparrowwallet/drongo/crypto/DumpedPrivateKey.java +++ b/src/main/java/com/sparrowwallet/drongo/crypto/DumpedPrivateKey.java @@ -63,7 +63,7 @@ public class DumpedPrivateKey extends VersionedChecksummedBytes { * Returns an ECKey created from this encoded private key. */ public ECKey getKey() { - return ECKey.fromPrivate(bytes); + return ECKey.fromPrivate(bytes, compressed); } @Override diff --git a/src/main/java/com/sparrowwallet/drongo/protocol/TransactionSignature.java b/src/main/java/com/sparrowwallet/drongo/protocol/TransactionSignature.java index 0ac8613..b15f722 100644 --- a/src/main/java/com/sparrowwallet/drongo/protocol/TransactionSignature.java +++ b/src/main/java/com/sparrowwallet/drongo/protocol/TransactionSignature.java @@ -99,7 +99,7 @@ public class TransactionSignature { } public static TransactionSignature decodeFromBitcoin(byte[] bytes, boolean requireCanonicalEncoding) throws SignatureDecodeException { - if(bytes.length == 64 || bytes.length == 65) { + if(bytes.length == 64) { return decodeFromBitcoin(Type.SCHNORR, bytes, requireCanonicalEncoding); }