Skip to content

Commit 5b15870

Browse files
committed
Use incrementalRelayFee for BIP 125 replacement
1 parent 82274c0 commit 5b15870

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,14 +898,14 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
898898
// Finally in addition to paying more fees than the conflicts the
899899
// new transaction must pay for its own bandwidth.
900900
CAmount nDeltaFees = nModifiedFees - nConflictingFees;
901-
if (nDeltaFees < ::minRelayTxFee.GetFee(nSize))
901+
if (nDeltaFees < ::incrementalRelayFee.GetFee(nSize))
902902
{
903903
return state.DoS(0, false,
904904
REJECT_INSUFFICIENTFEE, "insufficient fee", false,
905905
strprintf("rejecting replacement %s, not enough additional fees to relay; %s < %s",
906906
hash.ToString(),
907907
FormatMoney(nDeltaFees),
908-
FormatMoney(::minRelayTxFee.GetFee(nSize))));
908+
FormatMoney(::incrementalRelayFee.GetFee(nSize))));
909909
}
910910
}
911911

src/wallet/rpcwallet.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,8 +2652,8 @@ UniValue bumpfee(const JSONRPCRequest& request)
26522652
"By default, the new fee will be calculated automatically using estimatefee.\n"
26532653
"The user can specify a confirmation target for estimatefee.\n"
26542654
"Alternatively, the user can specify totalFee, or use RPC setpaytxfee to set a higher fee rate.\n"
2655-
"At a minimum, the new fee rate must be high enough to pay a new relay fee (relay fee amount returned\n"
2656-
"by getnetworkinfo RPC) and to enter the node's mempool.\n"
2655+
"At a minimum, the new fee rate must be high enough to pay a new relay fee over the original fee\n"
2656+
"to enter the node's mempool.\n"
26572657
"\nArguments:\n"
26582658
"1. txid (string, required) The txid to be bumped\n"
26592659
"2. options (object, optional)\n"
@@ -2787,9 +2787,9 @@ UniValue bumpfee(const JSONRPCRequest& request)
27872787
CFeeRate nNewFeeRate;
27882788

27892789
if (totalFee > 0) {
2790-
CAmount minTotalFee = nOldFeeRate.GetFee(maxNewTxSize) + minRelayTxFee.GetFee(maxNewTxSize);
2790+
CAmount minTotalFee = nOldFeeRate.GetFee(maxNewTxSize) + ::incrementalRelayFee.GetFee(maxNewTxSize);
27912791
if (totalFee < minTotalFee) {
2792-
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid totalFee, must be at least %s (oldFee %s + relayFee %s)", FormatMoney(minTotalFee), nOldFeeRate.GetFee(maxNewTxSize), minRelayTxFee.GetFee(maxNewTxSize)));
2792+
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid totalFee, must be at least %s (oldFee %s + relayFee %s)", FormatMoney(minTotalFee), nOldFeeRate.GetFee(maxNewTxSize), ::incrementalRelayFee.GetFee(maxNewTxSize)));
27932793
}
27942794
nNewFee = totalFee;
27952795
nNewFeeRate = CFeeRate(totalFee, maxNewTxSize);
@@ -2804,9 +2804,9 @@ UniValue bumpfee(const JSONRPCRequest& request)
28042804
nNewFeeRate = CWallet::fallbackFee;
28052805
}
28062806

2807-
// new fee rate must be at least old rate + minimum relay rate
2808-
if (nNewFeeRate.GetFeePerK() < nOldFeeRate.GetFeePerK() + ::minRelayTxFee.GetFeePerK()) {
2809-
nNewFeeRate = CFeeRate(nOldFeeRate.GetFeePerK() + ::minRelayTxFee.GetFeePerK());
2807+
// new fee rate must be at least old rate + minimum incremental relay rate
2808+
if (nNewFeeRate.GetFeePerK() < nOldFeeRate.GetFeePerK() + ::incrementalRelayFee.GetFeePerK()) {
2809+
nNewFeeRate = CFeeRate(nOldFeeRate.GetFeePerK() + ::incrementalRelayFee.GetFeePerK());
28102810
}
28112811

28122812
nNewFee = nNewFeeRate.GetFee(maxNewTxSize);

0 commit comments

Comments
 (0)