From fa3d62cf7b3501a056b34c5458c14d2fe6a55bd7 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 23 Nov 2021 18:07:00 +0100 Subject: Move FindForkInGlobalIndex from BlockManager to CChainState The helper was moved in commit b026e318c39f59a06e29f1b25c7f577e01b25ccb, which also mentioned that it could be moved to CChainState. So do that, as the functionality is not block-storage related. This also allows to drop one function argument. --- src/node/interfaces.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/node/interfaces.cpp') diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 075842ef73..8109dce2c0 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -494,8 +494,8 @@ public: std::optional findLocatorFork(const CBlockLocator& locator) override { LOCK(cs_main); - const CChain& active = Assert(m_node.chainman)->ActiveChain(); - if (CBlockIndex* fork = m_node.chainman->m_blockman.FindForkInGlobalIndex(active, locator)) { + const CChainState& active = Assert(m_node.chainman)->ActiveChainstate(); + if (CBlockIndex* fork = active.FindForkInGlobalIndex(locator)) { return fork->nHeight; } return std::nullopt; -- cgit v1.2.3