MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FindFork

Method FindFork

src/chain.cpp:50–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50const CBlockIndex* CChain::FindFork(const CBlockIndex& index) const
51{
52 const auto* pindex{&index};
53 if (pindex->nHeight > Height())
54 pindex = pindex->GetAncestor(Height());
55 while (pindex && !Contains(*pindex))
56 pindex = pindex->pprev;
57 return pindex;
58}
59
60CBlockIndex* CChain::FindEarliestAtLeast(int64_t nTime, int height) const
61{

Callers 7

StartIndexBackgroundSyncFunction · 0.80
ActivateBestChainStepMethod · 0.80
ActivateBestChainMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
EXCLUSIVE_LOCKS_REQUIREDFunction · 0.80
getchaintipsFunction · 0.80

Calls 3

HeightFunction · 0.85
ContainsFunction · 0.85
GetAncestorMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64