Remove Chainstate::LoadMempool

The 3-line function is only called once outside of tests, so it is
clearer to inline it.
This commit is contained in:
MarcoFalke
2023-08-07 10:59:50 +02:00
parent b7138252ac
commit 6888886cec
4 changed files with 8 additions and 13 deletions

View File

@@ -115,6 +115,7 @@
#endif
using kernel::DumpMempool;
using kernel::LoadMempool;
using kernel::ValidationCacheSizes;
using node::ApplyArgsManOptions;
@@ -1675,7 +1676,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
return;
}
// Load mempool from disk
chainman.ActiveChainstate().LoadMempool(ShouldPersistMempool(args) ? MempoolPath(args) : fs::path{});
if (auto* pool{chainman.ActiveChainstate().GetMempool()}) {
LoadMempool(*pool, ShouldPersistMempool(args) ? MempoolPath(args) : fs::path{}, chainman.ActiveChainstate());
pool->SetLoadTried(!chainman.m_interrupt);
}
});
// Wait for genesis block to be processed