diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index d662f63..7b28c9e 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -421,8 +421,10 @@ public class Wallet extends Persistable implements Comparable { public synchronized void updateTransactions(Map updatedTransactions) { for(BlockTransaction blockTx : updatedTransactions.values()) { if(!transactions.isEmpty()) { - Optional optionalLabel = transactions.values().stream().filter(oldBlTx -> oldBlTx.getHash().equals(blockTx.getHash())).map(BlockTransaction::getLabel).filter(Objects::nonNull).findFirst(); - optionalLabel.ifPresent(blockTx::setLabel); + BlockTransaction oldTx = transactions.get(blockTx.getHash()); + if(oldTx != null && oldTx.getLabel() != null) { + blockTx.setLabel(oldTx.getLabel()); + } } if(!detachedLabels.isEmpty()) {