Add BlockManagerOpts::chainparams reference

and use it in blockstorage.cpp
This commit is contained in:
MarcoFalke
2023-05-04 12:19:35 +02:00
parent 6c7ebcc14b
commit facdb8b331
8 changed files with 31 additions and 9 deletions

View File

@@ -381,10 +381,13 @@ struct SnapshotTestSetup : TestChain100Setup {
.datadir = m_args.GetDataDirNet(),
.adjusted_time_callback = GetAdjustedTime,
};
node::BlockManager::Options blockman_opts{
.chainparams = chainman_opts.chainparams,
};
// For robustness, ensure the old manager is destroyed before creating a
// new one.
m_node.chainman.reset();
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts, node::BlockManager::Options{});
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts, blockman_opts);
}
return *Assert(m_node.chainman);
}