fReindex = true;
}
- fTimeStampIndex = GetBoolArg("-timestampindex", DEFAULT_TIMESTAMPINDEX);
pblocktree->ReadFlag("timestampindex", checkval);
+ bool defaultState = DEFAULT_TIMESTAMPINDEX ? DEFAULT_TIMESTAMPINDEX : checkval;
+ fTimeStampIndex = GetBoolArg("-timestampindex", defaultState);
if (checkval != fTimeStampIndex)
{
- pblocktree->WriteFlag("timestampindex", fInsightExplorer);
+ pblocktree->WriteFlag("timestampindex", fTimeStampIndex);
fprintf(stderr,"set timestamp index, will reindex. sorry will take a while.\n");
fReindex = true;
}
- fInsightExplorer = GetBoolArg("-insightexplorer", DEFAULT_INSIGHTEXPLORER);
pblocktree->ReadFlag("insightexplorer", checkval);
+ defaultState = DEFAULT_INSIGHTEXPLORER ? DEFAULT_INSIGHTEXPLORER : checkval;
+ fInsightExplorer = GetBoolArg("-insightexplorer", defaultState);
if (checkval != fInsightExplorer)
{
pblocktree->WriteFlag("insightexplorer", fInsightExplorer);
return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString());
}
// Check the header
- if ( checkPOW != 0 )
+ if ( height != 0 && checkPOW != 0 )
{
komodo_block2pubkey33(pubkey33,(CBlock *)&block);
if (!(CheckEquihashSolution(&block, consensusParams) && CheckProofOfWork(block, pubkey33, height, consensusParams)))
return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString());
}
}
+ else if (height == 0 && block.GetHash() != consensusParams.hashGenesisBlock)
+ {
+ return error("ReadBlockFromDisk: Invalid block 0 genesis hash %s", block.GetHash().GetHex());
+ }
return true;
}