I am trying to create a altcoin using bitcoin source code.
i have changed the pszTimestamp, port number, magic number. I have cleared the DNS seeds and removed checkpoints for now. Then I printed the following values using printf and updated the new values: genesis.hashMerkleRoot and genesis.hashMerkleRoot
In the log file I see this error:
2017-10-04 18:32:29 ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8) 2017-10-04 18:32:29 *** Failed to read block 2017-10-04 18:32:29 Error: Error: A fatal internal error occurred, see debug.log for details
I tried to debug the code and i see that this is where it fails in pow.cpp :
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params) {
bool fNegative;
bool fOverflow;
arith_uint256 bnTarget;
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
// Check range
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
{
LogPrintf("\ncase 1\n");
return false;
}
// Check proof of work matches claimed amount
if (UintToArith256(hash) > bnTarget)
{
//LogPrintf(bnTarget);
LogPrintf("\ncase 2\n");
return false;
}
return true;
}
It prints case 2. What does this mean? What am I missing?