diff options
author | glozow <gloriajzhao@gmail.com> | 2021-07-27 10:03:49 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-08-24 15:47:21 +0100 |
commit | b001b9f6de7a039a468cf0f9645f3f0a430fa889 (patch) | |
tree | 4b06827230389feaaced0fc6ad7c7794261cb396 /src/validation.cpp | |
parent | 4fc15d15667d9d9c4fb5515ce73c05b4596298ec (diff) | |
download | bitcoin-b001b9f6de7a039a468cf0f9645f3f0a430fa889.tar.xz |
MOVEONLY: BIP125 max conflicts limit to policy/rbf.h
A circular dependency is added because policy now depends on txmempool and
txmempool depends on validation. It is natural for [mempool] policy to
rely on mempool; the problem is caused by txmempool depending on
validation. #22677 will resolve this.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index ec457da5cc..29f82c2de0 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -25,6 +25,7 @@ #include <node/coinstats.h> #include <node/ui_interface.h> #include <policy/policy.h> +#include <policy/rbf.h> #include <policy/settings.h> #include <pow.h> #include <primitives/block.h> @@ -810,7 +811,6 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) { CFeeRate newFeeRate(nModifiedFees, nSize); std::set<uint256> setConflictsParents; - const int maxDescendantsToVisit = 100; for (const auto& mi : setIterConflicting) { // Don't allow the replacement to reduce the feerate of the // mempool. @@ -846,7 +846,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) // This potentially overestimates the number of actual descendants // but we just want to be conservative to avoid doing too much // work. - if (nConflictingCount <= maxDescendantsToVisit) { + if (nConflictingCount <= MAX_BIP125_REPLACEMENT_CANDIDATES) { // If not too many to replace, then calculate the set of // transactions that would have to be evicted for (CTxMemPool::txiter it : setIterConflicting) { @@ -861,7 +861,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) strprintf("rejecting replacement %s; too many potential replacements (%d > %d)\n", hash.ToString(), nConflictingCount, - maxDescendantsToVisit)); + MAX_BIP125_REPLACEMENT_CANDIDATES)); } for (unsigned int j = 0; j < tx.vin.size(); j++) |