node-blockchain icon indicating copy to clipboard operation
node-blockchain copied to clipboard

Shouldn't blocks on the chain have both previous & current hashes?

Open lbragile opened this issue 4 years ago • 0 comments

According to the Bitcoin whitepaper and many videos I see online on the topic each block has a header (current hash that was mined) and prevHash matching the header of the previous block. However, this is not provided here so the chain is not actually a chain, but just many non-connected blocks. Furthermore, it seems that when forming a new block, the prevHash is not considered, but rather a new hash is made using the getter from class Block. Is this approach correct?

lbragile avatar Apr 09 '21 00:04 lbragile