Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sankycui opened this issue Feb 10, 2020 · 0 comments
Open

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

sankycui opened this issue Feb 10, 2020 · 0 comments

Comments

@sankycui
Copy link

sankycui commented Feb 10, 2020

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;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant