From 59d610f5395cab69a33cf675b3fb116f7e09394c Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 31 Aug 2020 11:21:29 +0200 Subject: [PATCH] support retreiving output scripts for different key purposes --- .../java/com/sparrowwallet/drongo/wallet/Wallet.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index 7a08229..3126ac8 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -259,9 +259,14 @@ public class Wallet { } public Map getWalletOutputScripts() { + return getWalletOutputScripts(KeyPurpose.RECEIVE, KeyPurpose.CHANGE); + } + + public Map getWalletOutputScripts(KeyPurpose... keyPurposes) { Map walletOutputScripts = new LinkedHashMap<>(); - getWalletOutputScripts(walletOutputScripts, getNode(KeyPurpose.RECEIVE)); - getWalletOutputScripts(walletOutputScripts, getNode(KeyPurpose.CHANGE)); + for(KeyPurpose keyPurpose : keyPurposes) { + getWalletOutputScripts(walletOutputScripts, getNode(keyPurpose)); + } return walletOutputScripts; }