MCPcopy Create free account
hub / github.com/ElementsProject/elements / SetTip

Method SetTip

src/chain.cpp:19–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void CChain::SetTip(CBlockIndex *pindex) {
20 if (pindex == nullptr) {
21 vChain.clear();
22 return;
23 }
24 vChain.resize(pindex->nHeight + 1);
25 while (pindex && vChain[pindex->nHeight] != pindex) {
26 vChain[pindex->nHeight] = pindex;
27 pindex = pindex->pprev;
28 }
29}
30
31CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
32 int nStep = 1;

Callers 7

DisconnectTipMethod · 0.80
ConnectTipMethod · 0.80
LoadChainTipMethod · 0.80
UnloadMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 2

clearMethod · 0.45
resizeMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64