support retreiving output scripts for different key purposes

This commit is contained in:
Craig Raw 2020-08-31 11:21:29 +02:00
parent 1003527854
commit 59d610f539

View file

@ -259,9 +259,14 @@ public class Wallet {
} }
public Map<Script, WalletNode> getWalletOutputScripts() { public Map<Script, WalletNode> getWalletOutputScripts() {
return getWalletOutputScripts(KeyPurpose.RECEIVE, KeyPurpose.CHANGE);
}
public Map<Script, WalletNode> getWalletOutputScripts(KeyPurpose... keyPurposes) {
Map<Script, WalletNode> walletOutputScripts = new LinkedHashMap<>(); Map<Script, WalletNode> walletOutputScripts = new LinkedHashMap<>();
getWalletOutputScripts(walletOutputScripts, getNode(KeyPurpose.RECEIVE)); for(KeyPurpose keyPurpose : keyPurposes) {
getWalletOutputScripts(walletOutputScripts, getNode(KeyPurpose.CHANGE)); getWalletOutputScripts(walletOutputScripts, getNode(keyPurpose));
}
return walletOutputScripts; return walletOutputScripts;
} }