naivecoin
naivecoin copied to clipboard
A bug at line 209 of the blockchain.ts , must return false
look at the location : //must return false return false;
const hasValidHash = (block: Block): boolean => {
if (!hashMatchesBlockContent(block)) {
console.log('invalid hash, got:' + block.hash);
return false;
}
if (!hashMatchesDifficulty(block.hash, block.difficulty)) {
console.log('block difficulty not satisfied. Expected: ' + block.difficulty + 'got: ' + block.hash);
//must return false
return false;
}
return true;
};