MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Verify

Method Verify

types/block.go:114–120  ·  view source on GitHub ↗

Verify verifies the merkle root and header signature of the block.

()

Source from the content-addressed store, hash-verified

112
113// Verify verifies the merkle root and header signature of the block.
114func (b *Block) Verify() (err error) {
115 // Verify merkle root
116 if merkleRoot := b.computeMerkleRoot(); !merkleRoot.IsEqual(&b.SignedHeader.MerkleRoot) {
117 return ErrMerkleRootVerification
118 }
119 return b.SignedHeader.Verify()
120}
121
122// VerifyAsGenesis verifies the block as a genesis block.
123func (b *Block) VerifyAsGenesis() (err error) {

Callers

nothing calls this directly

Calls 3

computeMerkleRootMethod · 0.95
VerifyMethod · 0.65
IsEqualMethod · 0.45

Tested by

no test coverage detected