From 23c802bb5f3f346f6230c1a367da5672e204a51e Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Sat, 24 Apr 2021 08:40:48 +0200 Subject: [PATCH] cpfp follow up --- .../com/sparrowwallet/sparrow/wallet/SendController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index c6722369..80ccc32e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -650,7 +650,6 @@ public class SendController extends WalletFormController implements Initializabl List unconfirmedUtxoTxs = walletTransaction.getSelectedUtxos().keySet().stream().filter(ref -> ref.getHeight() <= 0) .map(ref -> getWalletForm().getWallet().getTransactions().get(ref.getHash())).filter(Objects::nonNull).distinct().collect(Collectors.toList()); if(!unconfirmedUtxoTxs.isEmpty()) { - cpfpFeeRate.setVisible(true); long utxoTxFee = unconfirmedUtxoTxs.stream().mapToLong(BlockTransaction::getFee).sum(); double utxoTxSize = unconfirmedUtxoTxs.stream().mapToDouble(blkTx -> blkTx.getTransaction().getVirtualSize()).sum(); long thisFee = walletTransaction.getFee(); @@ -808,6 +807,7 @@ public class SendController extends WalletFormController implements Initializabl fee.setText(""); fee.textProperty().addListener(feeListener); + cpfpFeeRate.setVisible(false); fiatFeeAmount.setText(""); userFeeSet.set(false); @@ -1062,4 +1062,11 @@ public class SendController extends WalletFormController implements Initializabl public void includeMempoolOutputsChangedEvent(IncludeMempoolOutputsChangedEvent event) { updateTransaction(); } + + @Subscribe + public void newBlock(NewBlockEvent event) { + if(cpfpFeeRate.isVisible()) { + updateTransaction(); + } + } }