Check for null ptr before ->

This commit is contained in:
jl777
2019-04-21 02:16:55 -11:00
parent db2cf15b85
commit 06bed214f9
5 changed files with 17 additions and 5 deletions

View File

@@ -1091,6 +1091,17 @@ int32_t komodo_blockheight(uint256 hash)
return(0);
}
uint32_t komodo_blocktime(uint256 hash)
{
BlockMap::const_iterator it; CBlockIndex *pindex = 0;
if ( (it = mapBlockIndex.find(hash)) != mapBlockIndex.end() )
{
if ( (pindex= it->second) != 0 )
return(pindex->nTime);
}
return(0);
}
int32_t komodo_checkpoint(int32_t *notarized_heightp,int32_t nHeight,uint256 hash)
{
int32_t notarized_height,MoMdepth; uint256 MoM,notarized_hash,notarized_desttxid; CBlockIndex *notary,*pindex;