Skip to content

Commit

Permalink
fix genesis block comparison in isValidChain
Browse files Browse the repository at this point in the history
  • Loading branch information
koshikraj committed Mar 7, 2018
1 parent dfd2481 commit f09b432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var replaceChain = (newBlocks) => {
};

var isValidChain = (blockchainToValidate) => {
if (JSON.stringify(blockchainToValidate[0]) !== JSON.stringify(getGenesisBlock())) {
if (calculateHashForBlock(blockchainToValidate[0]) !== getGenesisBlock().hash) {
return false;
}
var tempBlocks = [blockchainToValidate[0]];
Expand Down

0 comments on commit f09b432

Please sign in to comment.