Savjee / SavjeeCoin

A simple blockchain in Javascript. For educational purposes only.
MIT License
1.74k stars 752 forks source link

isChainValid should check that previousHash matches the hash of its previous block? #45

Closed ilcasinistareloaded closed 3 years ago

ilcasinistareloaded commented 3 years ago

Hello again, maybe it is not an issue and I'm missing something, but shouldn't method isChainValid also check that for each block in the chain its Block.previousHash actually match the Block.hash of its previous block? Great work, again.

Savjee commented 3 years ago

It should, yes!

Can you submit a pull request for this?

ilcasinistareloaded commented 3 years ago

Oh, thanks for the offer but I don't know JavaScript; I translated it in a functional language to make it easier to understand (that's the reason of my odd second question in my previous issue: poor understanding of js). So, sorry but I can't help. Thanks for the quick reply!

Savjee commented 3 years ago

This has been fixed by @jhonderson