From cbfb7230a8ee703a5ab917cd46babdaad5590d45 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 10 Aug 2022 15:25:44 +0200 Subject: [PATCH] set transaction label on soroban collaborative transactions --- .../com/sparrowwallet/sparrow/wallet/SendController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index e9e2ec87..48748b1d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -1634,6 +1634,12 @@ public class SendController extends WalletFormController implements Initializabl } Optional optTransaction = initiatorDialog.showAndWait(); if(optTransaction.isPresent()) { + BlockTransaction blockTransaction = walletForm.getWallet().getWalletTransaction(optTransaction.get().getTxId()); + if(blockTransaction != null && blockTransaction.getLabel() == null && walletTransactionProperty.get() != null) { + blockTransaction.setLabel(walletTransactionProperty.get().getPayments().stream().map(Payment::getLabel).findFirst().orElse(null)); + TransactionEntry transactionEntry = new TransactionEntry(walletForm.getWallet(), blockTransaction, Collections.emptyMap(), Collections.emptyMap()); + EventManager.get().post(new WalletEntryLabelsChangedEvent(walletForm.getWallet(), List.of(transactionEntry))); + } clear(null); } });