MCPcopy
hub / github.com/hyperledger/fabric / BlockDataHash

Function BlockDataHash

protoutil/blockutils.go:69–74  ·  view source on GitHub ↗
(b *cb.BlockData)

Source from the content-addressed store, hash-verified

67}
68
69func BlockDataHash(b *cb.BlockData) ([]byte, error) {
70 if err := VerifyTransactionsAreWellFormed(b); err != nil {
71 return nil, err
72 }
73 return ComputeBlockDataHash(b), nil
74}
75
76func ComputeBlockDataHash(b *cb.BlockData) []byte {
77 sum := sha256.Sum256(bytes.Join(b.Data, nil))

Callers 8

VerifyBlockMethod · 0.92
checkBlockFunction · 0.92
nonConfigBlockFunction · 0.92
VerifyBlockHashFunction · 0.92
blockWithGroupsFunction · 0.92
VerifyBlockMethod · 0.92

Calls 2

ComputeBlockDataHashFunction · 0.85

Tested by 3

nonConfigBlockFunction · 0.74
blockWithGroupsFunction · 0.74