diff options
author | Carl Dong <contact@carldong.me> | 2020-08-25 16:40:21 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-01-28 14:15:26 -0500 |
commit | b026e318c39f59a06e29f1b25c7f577e01b25ccb (patch) | |
tree | f47575cf7c0ecbd69ae57817cc39a8b2f5fe02c2 /src/node/interfaces.cpp | |
parent | 3664a150ac7547c9336b571557af223d9e31aac9 (diff) |
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.
Diffstat (limited to 'src/node/interfaces.cpp')
-rw-r--r-- | src/node/interfaces.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index e0bd07bc5a..b7efd68cfd 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -447,7 +447,7 @@ public: { LOCK(cs_main); const CChain& active = Assert(m_node.chainman)->ActiveChain(); - if (CBlockIndex* fork = FindForkInGlobalIndex(active, locator)) { + if (CBlockIndex* fork = g_chainman.m_blockman.FindForkInGlobalIndex(active, locator)) { return fork->nHeight; } return nullopt; |