Hash computes and returns the block hash. If the block is incomplete, block hash is nil for safety.
()
| 121 | // Hash computes and returns the block hash. |
| 122 | // If the block is incomplete, block hash is nil for safety. |
| 123 | func (b *Block) Hash() tmbytes.HexBytes { |
| 124 | if b == nil { |
| 125 | return nil |
| 126 | } |
| 127 | b.mtx.Lock() |
| 128 | defer b.mtx.Unlock() |
| 129 | |
| 130 | if b.LastCommit == nil { |
| 131 | return nil |
| 132 | } |
| 133 | b.fillHeader() |
| 134 | return b.Header.Hash() |
| 135 | } |
| 136 | |
| 137 | // MakePartSet returns a PartSet containing parts of a serialized block. |
| 138 | // This is the form in which the block is gossipped to peers. |
no test coverage detected