diff options
| author | MarcoFalke <[email protected]> | 2020-09-07 09:47:14 +0200 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-09-07 09:47:28 +0200 |
| commit | 07087051afe9cd5a66ea3e9c0a05079b1ffff47f (patch) | |
| tree | 4a6dc9263bfb221450f046ca422ad26b1d474733 /src/validation.cpp | |
| parent | Merge #19738: wallet: Avoid multiple BerkeleyBatch in DelAddressBook (diff) | |
| parent | Remove mempool global (diff) | |
| download | discoin-07087051afe9cd5a66ea3e9c0a05079b1ffff47f.tar.xz discoin-07087051afe9cd5a66ea3e9c0a05079b1ffff47f.zip | |
Merge #19556: Remove mempool global
fafb381af8279b2d2ca768df0bf68d7eb036a2f9 Remove mempool global (MarcoFalke)
fa0359c5b30730744aa8a7cd9ffab79ded91041f Remove mempool global from p2p (MarcoFalke)
eeee1104d78eb59a582ee1709ff4ac2c33ee1190 Remove mempool global from init (MarcoFalke)
Pull request description:
This refactor unlocks some nice potential features, such as, but not limited to:
* Removing the fee estimates global (would avoid slightly fragile workarounds such as #18766)
* Making the mempool optional for a "blocksonly" operation mode
Even absent those features, the new code without the global should be easier to maintain, read and write tests for.
ACKs for top commit:
jnewbery:
utACK fafb381af8279b2d2ca768df0bf68d7eb036a2f9
hebasto:
ACK fafb381af8279b2d2ca768df0bf68d7eb036a2f9, I have reviewed the code and it looks OK, I agree it can be merged.
darosior:
ACK fafb381af8279b2d2ca768df0bf68d7eb036a2f9
Tree-SHA512: a2e696dc377e2e81eaf9c389e6d13dde4a48d81f3538df88f4da502d3012dd61078495140ab5a5854f360a06249fe0e1f6a094c4e006d8b5cc2552a946becf26
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 58af8744d..bdbae6651 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -148,7 +148,6 @@ arith_uint256 nMinimumChainWork; CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE); CBlockPolicyEstimator feeEstimator; -CTxMemPool mempool(&feeEstimator); // Internal stuff namespace { @@ -4227,6 +4226,14 @@ bool static LoadBlockIndexDB(ChainstateManager& chainman, const CChainParams& ch return true; } +void CChainState::LoadMempool(const ArgsManager& args) +{ + if (args.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { + ::LoadMempool(m_mempool); + } + m_mempool.SetIsLoaded(!ShutdownRequested()); +} + bool CChainState::LoadChainTip(const CChainParams& chainparams) { AssertLockHeld(cs_main); |