diff --git a/src/policy/rbf.cpp b/src/policy/rbf.cpp index e25f5c7c5bd..d15946de214 100644 --- a/src/policy/rbf.cpp +++ b/src/policy/rbf.cpp @@ -65,15 +65,15 @@ std::optional GetEntriesForConflicts(const CTransaction& tx, uint64_t nConflictingCount = 0; for (const auto& mi : iters_conflicting) { nConflictingCount += mi->GetCountWithDescendants(); - // BIP125 Rule #5: don't consider replacing more than MAX_BIP125_REPLACEMENT_CANDIDATES + // BIP125 Rule #5: don't consider replacing more than MAX_REPLACEMENT_CANDIDATES // entries from the mempool. This potentially overestimates the number of actual // descendants (i.e. if multiple conflicts share a descendant, it will be counted multiple // times), but we just want to be conservative to avoid doing too much work. - if (nConflictingCount > MAX_BIP125_REPLACEMENT_CANDIDATES) { + if (nConflictingCount > MAX_REPLACEMENT_CANDIDATES) { return strprintf("rejecting replacement %s; too many potential replacements (%d > %d)\n", txid.ToString(), nConflictingCount, - MAX_BIP125_REPLACEMENT_CANDIDATES); + MAX_REPLACEMENT_CANDIDATES); } } // Calculate the set of all transactions that would have to be evicted. diff --git a/src/policy/rbf.h b/src/policy/rbf.h index 07f68c8fd4e..f3efcebbe00 100644 --- a/src/policy/rbf.h +++ b/src/policy/rbf.h @@ -21,7 +21,7 @@ class uint256; /** Maximum number of transactions that can be replaced by BIP125 RBF (Rule #5). This includes all * mempool conflicts and their descendants. */ -static constexpr uint32_t MAX_BIP125_REPLACEMENT_CANDIDATES{100}; +static constexpr uint32_t MAX_REPLACEMENT_CANDIDATES{100}; /** The rbf state of unconfirmed transactions */ enum class RBFTransactionState { @@ -50,7 +50,7 @@ RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx); /** Get all descendants of iters_conflicting. Also enforce BIP125 Rule #5, "The number of original * transactions to be replaced and their descendant transactions which will be evicted from the * mempool must not exceed a total of 100 transactions." Quit as early as possible. There cannot be - * more than MAX_BIP125_REPLACEMENT_CANDIDATES potential entries. + * more than MAX_REPLACEMENT_CANDIDATES potential entries. * @param[in] iters_conflicting The set of iterators to mempool entries. * @param[out] all_conflicts Populated with all the mempool entries that would be replaced, * which includes descendants of iters_conflicting. Not cleared at diff --git a/src/validation.cpp b/src/validation.cpp index d018d185e91..da1b35f2551 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -450,7 +450,7 @@ public: /** Whether we allow transactions to replace mempool transactions by BIP125 rules. If false, * any transaction spending the same inputs as a transaction in the mempool is considered * a conflict. */ - const bool m_allow_bip125_replacement; + const bool m_allow_replacement; /** When true, the mempool will not be trimmed when individual transactions are submitted in * Finalize(). Instead, limits should be enforced at the end to ensure the package is not * partially submitted. @@ -470,7 +470,7 @@ public: /* m_bypass_limits */ bypass_limits, /* m_coins_to_uncache */ coins_to_uncache, /* m_test_accept */ test_accept, - /* m_allow_bip125_replacement */ true, + /* m_allow_replacement */ true, /* m_package_submission */ false, /* m_package_feerates */ false, }; @@ -484,7 +484,7 @@ public: /* m_bypass_limits */ false, /* m_coins_to_uncache */ coins_to_uncache, /* m_test_accept */ true, - /* m_allow_bip125_replacement */ false, + /* m_allow_replacement */ false, /* m_package_submission */ false, // not submitting to mempool /* m_package_feerates */ false, }; @@ -498,7 +498,7 @@ public: /* m_bypass_limits */ false, /* m_coins_to_uncache */ coins_to_uncache, /* m_test_accept */ false, - /* m_allow_bip125_replacement */ false, + /* m_allow_replacement */ false, /* m_package_submission */ true, /* m_package_feerates */ true, }; @@ -511,7 +511,7 @@ public: /* m_bypass_limits */ false, /* m_coins_to_uncache */ package_args.m_coins_to_uncache, /* m_test_accept */ package_args.m_test_accept, - /* m_allow_bip125_replacement */ true, + /* m_allow_replacement */ true, /* m_package_submission */ false, /* m_package_feerates */ false, // only 1 transaction }; @@ -525,7 +525,7 @@ public: bool bypass_limits, std::vector& coins_to_uncache, bool test_accept, - bool allow_bip125_replacement, + bool allow_replacement, bool package_submission, bool package_feerates) : m_chainparams{chainparams}, @@ -533,7 +533,7 @@ public: m_bypass_limits{bypass_limits}, m_coins_to_uncache{coins_to_uncache}, m_test_accept{test_accept}, - m_allow_bip125_replacement{allow_bip125_replacement}, + m_allow_replacement{allow_replacement}, m_package_submission{package_submission}, m_package_feerates{package_feerates} { @@ -732,7 +732,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) { const CTransaction* ptxConflicting = m_pool.GetConflictTx(txin.prevout); if (ptxConflicting) { - if (!args.m_allow_bip125_replacement) { + if (!args.m_allow_replacement) { // Transaction conflicts with a mempool tx, but we're not allowing replacements. return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "bip125-replacement-disallowed"); } @@ -1225,7 +1225,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std:: // package to spend. Since we already checked conflicts in the package and we don't allow // replacements, we don't need to track the coins spent. Note that this logic will need to be // updated if package replace-by-fee is allowed in the future. - assert(!args.m_allow_bip125_replacement); + assert(!args.m_allow_replacement); m_viewmempool.PackageAddTransaction(ws.m_ptx); }