mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +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:
@@ -3083,7 +3083,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
LOCK(cs_main);
|
||||
|
||||
// Find the last block the caller has in the main chain
|
||||
const CBlockIndex* pindex = m_chainman.m_blockman.FindForkInGlobalIndex(m_chainman.ActiveChain(), locator);
|
||||
const CBlockIndex* pindex = m_chainman.ActiveChainstate().FindForkInGlobalIndex(locator);
|
||||
|
||||
// Send the rest of the chain
|
||||
if (pindex)
|
||||
@@ -3203,7 +3203,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
else
|
||||
{
|
||||
// Find the last block the caller has in the main chain
|
||||
pindex = m_chainman.m_blockman.FindForkInGlobalIndex(m_chainman.ActiveChain(), locator);
|
||||
pindex = m_chainman.ActiveChainstate().FindForkInGlobalIndex(locator);
|
||||
if (pindex)
|
||||
pindex = m_chainman.ActiveChain().Next(pindex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user