mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
show warning dialog on broadcast if a transaction has a fee rate beyond the range slider maximum
This commit is contained in:
parent
deb47ca002
commit
0646c8aa28
1 changed files with 12 additions and 0 deletions
|
@ -1121,6 +1121,18 @@ public class HeadersController extends TransactionFormController implements Init
|
||||||
extractTransaction(event);
|
extractTransaction(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(fee.getValue() > 0) {
|
||||||
|
double feeRateAmt = fee.getValue() / headersForm.getTransaction().getVirtualSize();
|
||||||
|
if(feeRateAmt > AppServices.LONG_FEE_RATES_RANGE.get(AppServices.LONG_FEE_RATES_RANGE.size() - 1)) {
|
||||||
|
Optional<ButtonType> optType = AppServices.showWarningDialog("Very high fee rate!",
|
||||||
|
"This transaction pays a very high fee rate of " + String.format("%.0f", feeRateAmt) + " sats/vB.\n\nBroadcast this transaction?", ButtonType.YES, ButtonType.NO);
|
||||||
|
if(optType.isPresent() && optType.get() == ButtonType.NO) {
|
||||||
|
broadcastButton.setDisable(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(headersForm.getSigningWallet() instanceof FinalizingPSBTWallet) {
|
if(headersForm.getSigningWallet() instanceof FinalizingPSBTWallet) {
|
||||||
//Ensure the script hashes of the UTXOs in FinalizingPSBTWallet are subscribed to
|
//Ensure the script hashes of the UTXOs in FinalizingPSBTWallet are subscribed to
|
||||||
ElectrumServer.TransactionHistoryService historyService = new ElectrumServer.TransactionHistoryService(headersForm.getSigningWallet());
|
ElectrumServer.TransactionHistoryService historyService = new ElectrumServer.TransactionHistoryService(headersForm.getSigningWallet());
|
||||||
|
|
Loading…
Reference in a new issue