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?
According to the Bitcoin whitepaper and many videos I see online on the topic each block has a
header(current hash that was mined) andprevHashmatching 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, theprevHashis not considered, but rather a new hash is made using the getter fromclass Block. Is this approach correct?