MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / Hash

Method Hash

types/block.go:123–135  ·  view source on GitHub ↗

Hash computes and returns the block hash. If the block is incomplete, block hash is nil for safety.

()

Source from the content-addressed store, hash-verified

121// Hash computes and returns the block hash.
122// If the block is incomplete, block hash is nil for safety.
123func (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.

Callers 5

HashesToMethod · 0.95
StringIndentedMethod · 0.95
StringShortMethod · 0.95
defaultDecideProposalMethod · 0.95
defaultDecideProposalMethod · 0.95

Calls 4

fillHeaderMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected