From 06b88ffb8ae7f2b2a93a32908cd80e77fafd270c Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 12 Jul 2022 21:42:00 -0400 Subject: LoadMempool: Pass in load_path, stop using gArgs Also: 1. Have CChainState::LoadMempool and ::ThreadImport take in paths and pass it through untouched to LoadMempool. 2. Make LoadMempool exit early if the load_path is empty. 3. Adjust the call to ::ThreadImport in ::AppInitMain to correctly pass in an empty path if mempool persistence is disabled. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 62eff218cb..542b6f105f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1673,7 +1673,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) } chainman.m_load_block = std::thread(&util::TraceThread, "loadblk", [=, &chainman, &args] { - ThreadImport(chainman, vImportFiles, args); + ThreadImport(chainman, vImportFiles, args, ShouldPersistMempool(args) ? MempoolPath(args) : fs::path{}); }); // Wait for genesis block to be processed -- cgit v1.2.3