diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index 22ca6af9..bb719c2a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -1121,6 +1121,18 @@ public class HeadersController extends TransactionFormController implements Init 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 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) { //Ensure the script hashes of the UTXOs in FinalizingPSBTWallet are subscribed to ElectrumServer.TransactionHistoryService historyService = new ElectrumServer.TransactionHistoryService(headersForm.getSigningWallet());