From f73cabad3c76c1eb28b4f02b17c9beb608ba2aa4 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 9 Feb 2022 16:07:26 +0200 Subject: [PATCH] remove unused copy labels method --- .../drongo/wallet/WalletNode.java | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java b/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java index 27676fa..2394116 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/WalletNode.java @@ -248,43 +248,6 @@ public class WalletNode extends Persistable implements Comparable { return copy; } - public boolean copyLabels(WalletNode pastNode) { - if(pastNode == null) { - return false; - } - - boolean changed = false; - - if(label == null && pastNode.label != null) { - label = pastNode.label; - changed = true; - } - - for(BlockTransactionHashIndex txo : getTransactionOutputs()) { - Optional optPastTxo = pastNode.getTransactionOutputs().stream().filter(pastTxo -> pastTxo.equals(txo)).findFirst(); - if(optPastTxo.isPresent()) { - BlockTransactionHashIndex pastTxo = optPastTxo.get(); - if(txo.getLabel() == null && pastTxo.getLabel() != null) { - txo.setLabel(pastTxo.getLabel()); - changed = true; - } - if(txo.isSpent() && pastTxo.isSpent() && txo.getSpentBy().getLabel() == null && pastTxo.getSpentBy().getLabel() != null) { - txo.getSpentBy().setLabel(pastTxo.getSpentBy().getLabel()); - changed = true; - } - } - } - - for(WalletNode childNode : getChildren()) { - Optional optPastChildNode = pastNode.getChildren().stream().filter(node -> node.equals(childNode)).findFirst(); - if(optPastChildNode.isPresent()) { - changed |= childNode.copyLabels(optPastChildNode.get()); - } - } - - return changed; - } - public static String nodeRangesToString(Set nodes) { return nodeRangesToString(nodes.stream().map(WalletNode::getDerivationPath).collect(Collectors.toList())); }