add additional fee rate limit check for high fee transactions

This commit is contained in:
Craig Raw
2026-01-13 16:30:57 +02:00
parent 0c67962730
commit 96f7d4bdb3
@@ -86,6 +86,8 @@ public class HeadersController extends TransactionFormController implements Init
private static final Pattern RBF_INSUFFICIENT_FEE = Pattern.compile("insufficient fee, rejecting replacement.*?(\\d+\\.?\\d*) < (\\d+\\.?\\d*)");
private static final Pattern RBF_INSUFFICIENT_FEE_RATE = Pattern.compile("insufficient fee, rejecting replacement.*new feerate (\\d+\\.?\\d*)[^\\d]*(\\d+\\.?\\d*)[^\\d]*");
private static final double FEE_MULTIPLE_LIMIT = 100d;
private HeadersForm headersForm;
@FXML
@@ -1220,7 +1222,7 @@ public class HeadersController extends TransactionFormController implements Init
if(fee.getValue() > 0) {
double feeRateAmt = fee.getValue() / headersForm.getTransaction().getVirtualSize();
if(feeRateAmt > AppServices.getLongFeeRatesRange().getLast()) {
if(feeRateAmt > AppServices.getLongFeeRatesRange().getLast() || (AppServices.getTargetBlockFeeRates() != null && feeRateAmt > AppServices.getDefaultFeeRate() * FEE_MULTIPLE_LIMIT)) {
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) {