From da14a9bf34945713494cfbef86f8f44aedbc727f Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 26 Nov 2021 14:04:46 +0200 Subject: [PATCH] add retrieval of wallet nodes and history --- src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index 97c9787..4a9633c 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -509,6 +509,13 @@ public class Wallet extends Persistable implements Comparable { } } + public Map> getWalletNodes() { + Map> walletNodes = new LinkedHashMap<>(); + getNode(KeyPurpose.RECEIVE).getChildren().forEach(childNode -> walletNodes.put(childNode, childNode.getTransactionOutputs())); + getNode(KeyPurpose.CHANGE).getChildren().forEach(childNode -> walletNodes.put(childNode, childNode.getTransactionOutputs())); + return walletNodes; + } + public boolean isWalletAddress(Address address) { return getWalletAddresses().containsKey(address); }