From 65e13d7b506cec929d03962f5889975ae5ab55c5 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 27 Apr 2021 08:17:30 +0200 Subject: [PATCH] fix adding new payment tabs, update last used label on connection --- .../sparrowwallet/sparrow/wallet/ReceiveController.java | 5 +++++ .../com/sparrowwallet/sparrow/wallet/SendController.java | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java index a6333d75..3bf26f13 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java @@ -304,4 +304,9 @@ public class ReceiveController extends WalletFormController implements Initializ public void usbDevicesFound(UsbDeviceEvent event) { updateDisplayAddress(event.getDevices()); } + + @Subscribe + public void connection(ConnectionEvent event) { + updateLastUsed(); + } } \ No newline at end of file diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index f222924f..a786a5af 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -478,6 +478,10 @@ public class SendController extends WalletFormController implements Initializabl } public void updateTransaction(List transactionPayments) { + if(walletTransactionService != null && walletTransactionService.isRunning()) { + walletTransactionService.cancel(); + } + try { List payments = transactionPayments != null ? transactionPayments : getPayments(); if(!userFeeSet.get() || (getFeeValueSats() != null && getFeeValueSats() > 0)) { @@ -489,10 +493,6 @@ public class SendController extends WalletFormController implements Initializabl boolean includeMempoolOutputs = Config.get().isIncludeMempoolOutputs(); boolean includeSpentMempoolOutputs = includeSpentMempoolOutputsProperty.get(); - if(walletTransactionService != null && walletTransactionService.isRunning()) { - walletTransactionService.cancel(); - } - walletTransactionService = new WalletTransactionService(wallet, getUtxoSelectors(), getUtxoFilters(), payments, feeRate, getMinimumFeeRate(), userFee, currentBlockHeight, groupByAddress, includeMempoolOutputs, includeSpentMempoolOutputs); walletTransactionService.setOnSucceeded(event -> { walletTransactionProperty.setValue(walletTransactionService.getValue());