| 45 | } |
| 46 | |
| 47 | CBlockIndex *CChain::SetTip(CBlockIndex *pIndex) { |
| 48 | if (pIndex == nullptr) { |
| 49 | vChain.clear(); |
| 50 | return nullptr; |
| 51 | } |
| 52 | vChain.resize(pIndex->height + 1); |
| 53 | while (pIndex && vChain[pIndex->height] != pIndex) { |
| 54 | vChain[pIndex->height] = pIndex; |
| 55 | pIndex = pIndex->pprev; |
| 56 | } |
| 57 | return pIndex; |
| 58 | } |
| 59 | |
| 60 | CBlockLocator CChain::GetLocator(const CBlockIndex *pIndex) const { |
| 61 | int32_t nStep = 1; |
no test coverage detected