diff --git a/drongo b/drongo index 2e1012da..24cde9d0 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 2e1012da8b1135ba1569a6bc4c8b2fc856af17c8 +Subproject commit 24cde9d073da636fbc2150b7abbd50b48342e040 diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java b/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java index d115b471..b0d3b1b3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java @@ -288,13 +288,7 @@ public class ElectrumServer { } if(!transactionMap.equals(wallet.getTransactions())) { - for(BlockTransaction blockTx : transactionMap.values()) { - Optional optionalLabel = wallet.getTransactions().values().stream().filter(oldBlTx -> oldBlTx.getHash().equals(blockTx.getHash())).map(BlockTransaction::getLabel).filter(Objects::nonNull).findFirst(); - optionalLabel.ifPresent(blockTx::setLabel); - } - - wallet.getTransactions().clear(); - wallet.getTransactions().putAll(transactionMap); + wallet.updateTransactions(transactionMap); } } @@ -481,13 +475,7 @@ public class ElectrumServer { } if(!transactionOutputs.equals(node.getTransactionOutputs())) { - for(BlockTransactionHashIndex txo : transactionOutputs) { - Optional optionalLabel = node.getTransactionOutputs().stream().filter(oldTxo -> oldTxo.getHash().equals(txo.getHash()) && oldTxo.getIndex() == txo.getIndex() && oldTxo.getLabel() != null).map(BlockTransactionHash::getLabel).findFirst(); - optionalLabel.ifPresent(txo::setLabel); - } - - node.getTransactionOutputs().clear(); - node.getTransactionOutputs().addAll(transactionOutputs); + node.updateTransactionOutputs(transactionOutputs); } }