mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 16:43:14 +00:00
add additional fee rate limit check for high fee transactions
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user