MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SetTip

Method SetTip

src/chain.cpp:11–21  ·  view source on GitHub ↗

* CChain implementation */

Source from the content-addressed store, hash-verified

9 * CChain implementation
10 */
11void CChain::SetTip(CBlockIndex *pindex) {
12 if (pindex == nullptr) {
13 vChain.clear();
14 return;
15 }
16 vChain.resize(pindex->nHeight + 1);
17 while (pindex && vChain[pindex->nHeight] != pindex) {
18 vChain[pindex->nHeight] = pindex;
19 pindex = pindex->pprev;
20 }
21}
22
23CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
24 int nStep = 1;

Callers 6

DisconnectTipMethod · 0.80
ConnectTipMethod · 0.80
LoadChainTipFunction · 0.80
UnloadBlockIndexFunction · 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