| 17 | } |
| 18 | |
| 19 | void 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 | |
| 31 | CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { |
| 32 | int nStep = 1; |