Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. //CheckNewBlockHash ...
  2. func (b *Blockchain) CheckNewBlockHash(newBlock Block) bool {
  3. lastBlock := b.GetLastBlock()
  4. correctHash := lastBlock.Hash == newBlock.PreviousBlockHash
  5. correctIndex := (lastBlock.Index + 1) == newBlock.Index
  6.  
  7. return (correctHash && correctIndex)
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement