mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Move FindForkInGlobalIndex from BlockManager to CChainState
The helper was moved in commit b026e318c3,
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.
This commit is contained in:
@@ -494,8 +494,8 @@ public:
|
||||
std::optional<int> 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;
|
||||
|
||||
Reference in New Issue
Block a user