From 2aa3d834029dfa1db334c1e27600f6d3c47ba9ea Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 29 Jul 2021 11:40:15 +0200 Subject: [PATCH] fix using the correct address label for the utxo label when recieving a batched tx to several labelled address --- .../java/com/sparrowwallet/sparrow/wallet/WalletForm.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java index f6c190fc..30f3c133 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java @@ -381,6 +381,11 @@ public class WalletForm { blockTransaction.setLabel(changedNode.getLabel()); changedLabelEntries.add(new TransactionEntry(event.getWallet(), blockTransaction, Collections.emptyMap(), Collections.emptyMap())); } + + if(receivedRef.getLabel() == null || receivedRef.getLabel().isEmpty()) { + receivedRef.setLabel(changedNode.getLabel() + (changedNode.getKeyPurpose() == KeyPurpose.CHANGE ? " (change)" : " (received)")); + changedLabelEntries.add(new HashIndexEntry(event.getWallet(), receivedRef, HashIndexEntry.Type.OUTPUT, changedNode.getKeyPurpose())); + } } if(!changedLabelEntries.isEmpty()) {