naivecoin icon indicating copy to clipboard operation
naivecoin copied to clipboard

A bug at line 209 of the blockchain.ts , must return false

Open sankycui opened this issue 5 years ago • 0 comments

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;
};

sankycui avatar Feb 10 '20 13:02 sankycui