aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-19 20:30:46 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-09-05 16:24:56 +0200
commitfafb381af8279b2d2ca768df0bf68d7eb036a2f9 (patch)
tree35e45709d385b239d7470aca4bec066e68ee72f9 /src/init.cpp
parentfa0359c5b30730744aa8a7cd9ffab79ded91041f (diff)
downloadbitcoin-fafb381af8279b2d2ca768df0bf68d7eb036a2f9.tar.xz
Remove mempool global
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 60042c682b..633dd8cefc 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -302,7 +302,7 @@ void Shutdown(NodeContext& node)
GetMainSignals().UnregisterBackgroundSignalScheduler();
globalVerifyHandle.reset();
ECC_Stop();
- node.mempool = nullptr;
+ node.mempool.reset();
node.chainman = nullptr;
node.scheduler.reset();
@@ -1364,7 +1364,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
// Make mempool generally available in the node context. For example the connection manager, wallet, or RPC threads,
// which are all started after this, may use it from the node context.
assert(!node.mempool);
- node.mempool = &::mempool;
+ node.mempool = MakeUnique<CTxMemPool>(&::feeEstimator);
if (node.mempool) {
int ratio = std::min<int>(std::max<int>(args.GetArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
if (ratio != 0) {
@@ -1559,7 +1559,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
chainman.m_total_coinstip_cache = nCoinCacheUsage;
chainman.m_total_coinsdb_cache = nCoinDBCache;
- UnloadBlockIndex(node.mempool);
+ UnloadBlockIndex(node.mempool.get());
// new CBlockTreeDB tries to delete the existing file, which
// fails if it's still open from the previous loop. Close it first: