mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
refactor: Delete ChainstateManager::GetAll() method
Just use m_chainstates array instead.
This commit is contained in:
@@ -345,7 +345,7 @@ void Shutdown(NodeContext& node)
|
||||
// FlushStateToDisk generates a ChainStateFlushed callback, which we should avoid missing
|
||||
if (node.chainman) {
|
||||
LOCK(cs_main);
|
||||
for (Chainstate* chainstate : node.chainman->GetAll()) {
|
||||
for (const auto& chainstate : node.chainman->m_chainstates) {
|
||||
if (chainstate->CanFlushToDisk()) {
|
||||
chainstate->ForceFlushStateToDisk();
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void Shutdown(NodeContext& node)
|
||||
|
||||
if (node.chainman) {
|
||||
LOCK(cs_main);
|
||||
for (Chainstate* chainstate : node.chainman->GetAll()) {
|
||||
for (const auto& chainstate : node.chainman->m_chainstates) {
|
||||
if (chainstate->CanFlushToDisk()) {
|
||||
chainstate->ForceFlushStateToDisk();
|
||||
chainstate->ResetCoinsViews();
|
||||
@@ -1873,7 +1873,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
if (chainman.m_blockman.IsPruneMode()) {
|
||||
if (chainman.m_blockman.m_blockfiles_indexed) {
|
||||
LOCK(cs_main);
|
||||
for (Chainstate* chainstate : chainman.GetAll()) {
|
||||
for (const auto& chainstate : chainman.m_chainstates) {
|
||||
uiInterface.InitMessage(_("Pruning blockstore…"));
|
||||
chainstate->PruneAndFlush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user