avoid null labels when broadcasting a loaded transaction with no name

This commit is contained in:
Craig Raw 2024-01-22 09:12:00 +02:00
parent 1e74ae5f19
commit 30001051c7
2 changed files with 2 additions and 2 deletions

2
drongo

@ -1 +1 @@
Subproject commit 42f279e5e7cfdcf0de80f60f65857d26db8580ad Subproject commit a436de319a763c36e3a8944af77ebf6e267a4084

View file

@ -1580,7 +1580,7 @@ public class HeadersController extends TransactionFormController implements Init
output.setLabel(label + (walletNode.getKeyPurpose() == KeyPurpose.CHANGE ? (walletNode.getWallet().isBip47() ? " (sent)" : " (change)") : " (received)")); output.setLabel(label + (walletNode.getKeyPurpose() == KeyPurpose.CHANGE ? (walletNode.getWallet().isBip47() ? " (sent)" : " (change)") : " (received)"));
changedLabelEntries.add(new HashIndexEntry(event.getWallet(), output, HashIndexEntry.Type.OUTPUT, walletNode.getKeyPurpose())); changedLabelEntries.add(new HashIndexEntry(event.getWallet(), output, HashIndexEntry.Type.OUTPUT, walletNode.getKeyPurpose()));
} }
if(output.getSpentBy() != null && output.getSpentBy().getHash().equals(txid) && output.getSpentBy().getLabel() == null) { //The norm - sending out if(output.getSpentBy() != null && output.getSpentBy().getHash().equals(txid) && output.getSpentBy().getLabel() == null && headersForm.getName() != null) { //The norm - sending out
output.getSpentBy().setLabel(headersForm.getName() + " (input)"); output.getSpentBy().setLabel(headersForm.getName() + " (input)");
changedLabelEntries.add(new HashIndexEntry(event.getWallet(), output.getSpentBy(), HashIndexEntry.Type.INPUT, walletNode.getKeyPurpose())); changedLabelEntries.add(new HashIndexEntry(event.getWallet(), output.getSpentBy(), HashIndexEntry.Type.INPUT, walletNode.getKeyPurpose()));
} }