Move pblocktree global to BlockManager

This commit is contained in:
MarcoFalke
2021-07-01 10:24:58 +02:00
parent fa27f03b49
commit faa54e3757
7 changed files with 17 additions and 22 deletions

View File

@@ -264,7 +264,6 @@ void Shutdown(NodeContext& node)
chainstate->ResetCoinsViews();
}
}
pblocktree.reset();
}
for (const auto& client : node.chain_clients) {
client->stop();
@@ -1355,6 +1354,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
UnloadBlockIndex(node.mempool.get(), chainman);
auto& pblocktree{chainman.m_blockman.m_block_tree_db};
// new CBlockTreeDB tries to delete the existing file, which
// fails if it's still open from the previous loop. Close it first:
pblocktree.reset();