Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CheckNewBlockHash ...
- func (b *Blockchain) CheckNewBlockHash(newBlock Block) bool {
- lastBlock := b.GetLastBlock()
- correctHash := lastBlock.Hash == newBlock.PreviousBlockHash
- correctIndex := (lastBlock.Index + 1) == newBlock.Index
- return (correctHash && correctIndex)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement