komodo_getblockindex instead of mapblockindex[] to prevent creation of new entry on miss
This commit is contained in:
@@ -510,7 +510,7 @@ int32_t komodo_validate_chain(uint256 srchash,int32_t notarized_height)
|
||||
static int32_t last_rewind; int32_t rewindtarget; CBlockIndex *pindex; struct komodo_state *sp; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN];
|
||||
if ( (sp= komodo_stateptr(symbol,dest)) == 0 )
|
||||
return(0);
|
||||
if ( IsInitialBlockDownload() == 0 && ((pindex= mapBlockIndex[srchash]) == 0 || pindex->GetHeight() != notarized_height) )
|
||||
if ( IsInitialBlockDownload() == 0 && ((pindex= komodo_getblockindex(srchash)) == 0 || pindex->GetHeight() != notarized_height) )
|
||||
{
|
||||
if ( sp->NOTARIZED_HEIGHT > 0 && sp->NOTARIZED_HEIGHT < notarized_height )
|
||||
rewindtarget = sp->NOTARIZED_HEIGHT - 1;
|
||||
|
||||
Reference in New Issue
Block a user