Savjee/SavjeeCoin

Is chain valid? false

Berk2007 opened this issue · 3 comments

After I tried to see if my block was valid but no matter what I did, it still said that it was not valid. I put my code below.
Blockchain.js:
Screen Shot 2022-01-18 at 2 46 10 PM
Screen Shot 2022-01-18 at 2 46 21 PM
Screen Shot 2022-01-18 at 2 46 30 PM
Screen Shot 2022-01-18 at 2 46 41 PM
Screen Shot 2022-01-18 at 2 46 48 PM
Main.js:
Screen Shot 2022-01-18 at 2 50 20 PM
Keygenerator.js:
Screen Shot 2022-01-18 at 2 50 31 PM
Hopefully, someone can help me.

Hi,

Did you write the code yourself or did you clone this repository?
I can't replicate this issue with the code in this repo.

Hi,

I had the same issue. I found my isChainValid() method was slightly different from the one in this repo. Once I copied isChainValid() from this repo, the issue was fixed. Also make sure that in minePendingTransactions(), when you create the new Block, it adds a hash value to it.

Thanks for letting us know!
Closing this issue for now.