From b026e318c39f59a06e29f1b25c7f577e01b25ccb Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 25 Aug 2020 16:40:21 -0400 Subject: validation: Move FindForkInGlobalIndex to BlockManager [META] This commit should be followed up by removing the comments and assertions meant only to show that the change is correct. FindForkInGlobalIndex only acts on BlockManager. Note to reviewers: Since FindForkInGlobalIndex is always called with ::ChainActive() as its first parameter, it is possible to move FindForkInGlobalIndex to CChainState and remove this const CChain& parameter to instead use m_chain. However, it seems like the original intention was for FindForkInGlobalIndex to work with _any_ chain, not just the current active chain. Let me know if this should be changed. --- src/index/base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/index') diff --git a/src/index/base.cpp b/src/index/base.cpp index 505c9c45b7..3d3dda95b1 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -62,7 +62,7 @@ bool BaseIndex::Init() if (locator.IsNull()) { m_best_block_index = nullptr; } else { - m_best_block_index = FindForkInGlobalIndex(::ChainActive(), locator); + m_best_block_index = g_chainman.m_blockman.FindForkInGlobalIndex(::ChainActive(), locator); } m_synced = m_best_block_index.load() == ::ChainActive().Tip(); return true; -- cgit v1.2.3