cpfp follow up

This commit is contained in:
Craig Raw 2021-04-24 08:40:48 +02:00
parent 4567f62ef8
commit 23c802bb5f

View file

@ -650,7 +650,6 @@ public class SendController extends WalletFormController implements Initializabl
List<BlockTransaction> 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();
}
}
}