From 72a2a8bd1becaa77371d1e644c3b9e76b757a8ed Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 31 Jul 2020 10:36:21 +0200 Subject: [PATCH] better canSign protection --- .../sparrowwallet/drongo/wallet/FinalizingPSBTWallet.java | 5 +++++ src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/FinalizingPSBTWallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/FinalizingPSBTWallet.java index 07df1f1..543bbe5 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/FinalizingPSBTWallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/FinalizingPSBTWallet.java @@ -115,4 +115,9 @@ public class FinalizingPSBTWallet extends Wallet { return new Script(new byte[10]); } + + @Override + public boolean canSign(PSBT psbt) { + return !getSigningNodes(psbt).isEmpty(); + } } \ No newline at end of file diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index 9e3f52b..e181280 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -578,7 +578,7 @@ public class Wallet { } public boolean canSign(PSBT psbt) { - return !getSigningNodes(psbt).isEmpty(); + return isValid() && !getSigningNodes(psbt).isEmpty(); } /**