mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
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.
This commit is contained in:
@@ -823,7 +823,7 @@ struct CImportingNow {
|
||||
}
|
||||
};
|
||||
|
||||
void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFiles, const ArgsManager& args)
|
||||
void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFiles, const ArgsManager& args, const fs::path& mempool_path)
|
||||
{
|
||||
SetSyscallSandboxPolicy(SyscallSandboxPolicy::INITIALIZATION_LOAD_BLOCKS);
|
||||
ScheduleBatchPriority();
|
||||
@@ -893,6 +893,6 @@ void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFile
|
||||
return;
|
||||
}
|
||||
} // End scope of CImportingNow
|
||||
chainman.ActiveChainstate().LoadMempool(args);
|
||||
chainman.ActiveChainstate().LoadMempool(mempool_path);
|
||||
}
|
||||
} // namespace node
|
||||
|
||||
@@ -211,7 +211,7 @@ bool ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatFilePos& pos, c
|
||||
|
||||
bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex);
|
||||
|
||||
void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFiles, const ArgsManager& args);
|
||||
void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFiles, const ArgsManager& args, const fs::path& mempool_path);
|
||||
} // namespace node
|
||||
|
||||
#endif // BITCOIN_NODE_BLOCKSTORAGE_H
|
||||
|
||||
Reference in New Issue
Block a user