Merge ae6943620a into merged_master (Bitcoin PR #17407)

This commit is contained in:
Andrew Poelstra 2020-11-09 23:10:14 +00:00
commit fcc3e6c04c
11 changed files with 100 additions and 75 deletions

View file

@ -289,6 +289,7 @@ void Shutdown(NodeContext& node)
GetMainSignals().UnregisterWithMempoolSignals(mempool);
globalVerifyHandle.reset();
ECC_Stop();
if (node.mempool) node.mempool = nullptr;
LogPrintf("%s: done\n", __func__);
}
@ -1690,6 +1691,11 @@ bool AppInitMain(NodeContext& node)
return false;
}
// Now that the chain state is loaded, 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;
fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION);
// Allowed to fail as this file IS missing on first startup.