HashesTo is a convenience function that checks if a block hashes to the given argument. Returns false if the block is nil or the hash is empty.
(hash []byte)
| 158 | // HashesTo is a convenience function that checks if a block hashes to the given argument. |
| 159 | // Returns false if the block is nil or the hash is empty. |
| 160 | func (b *Block) HashesTo(hash []byte) bool { |
| 161 | if len(hash) == 0 { |
| 162 | return false |
| 163 | } |
| 164 | if b == nil { |
| 165 | return false |
| 166 | } |
| 167 | return bytes.Equal(b.Hash(), hash) |
| 168 | } |
| 169 | |
| 170 | // Size returns size of the block in bytes. |
| 171 | func (b *Block) Size() int { |