Protect from null ptr on chain tip

This commit is contained in:
Michael Toutonghi
2018-07-14 21:45:38 -07:00
parent 7756dac0c7
commit 37ad688668
4 changed files with 43 additions and 26 deletions

View File

@@ -253,7 +253,16 @@ bool CCoinsViewCache::HaveCoins(const uint256 &txid) const {
uint256 CCoinsViewCache::GetBestBlock() const {
if (hashBlock.IsNull())
hashBlock = base->GetBestBlock();
{
if (base)
{
hashBlock = base->GetBestBlock();
}
else
{
hashBlock = uint256();
}
}
return hashBlock;
}