diff options
Diffstat (limited to 'src/chain.cpp')
-rw-r--r-- | src/chain.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/chain.cpp b/src/chain.cpp index 0f898bafd5..446bb216c2 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -18,11 +18,9 @@ std::string CBlockIndex::ToString() const pprev, nHeight, hashMerkleRoot.ToString(), GetBlockHash().ToString()); } -void CChain::SetTip(CBlockIndex *pindex) { - if (pindex == nullptr) { - vChain.clear(); - return; - } +void CChain::SetTip(CBlockIndex& block) +{ + CBlockIndex* pindex = █ vChain.resize(pindex->nHeight + 1); while (pindex && vChain[pindex->nHeight] != pindex) { vChain[pindex->nHeight] = pindex; |