From 42de57026c2c2d8f0feaa2e7a9db33e4decc617f Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 12 Apr 2024 09:11:16 +0200 Subject: [PATCH] add test to determine if wallet can sign all psbt inputs --- src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index bfcc768..8db827a 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -1461,6 +1461,10 @@ public class Wallet extends Persistable implements Comparable { return isValid() && !getSigningNodes(psbt).isEmpty(); } + public boolean canSignAllInputs(PSBT psbt) { + return isValid() && getSigningNodes(psbt).size() == psbt.getPsbtInputs().size(); + } + /** * Determines which nodes in this wallet can sign which inputs in the provided PSBT *