Verify verifies the merkle root and header signature of the block.
()
| 112 | |
| 113 | // Verify verifies the merkle root and header signature of the block. |
| 114 | func (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. |
| 123 | func (b *Block) VerifyAsGenesis() (err error) { |
nothing calls this directly
no test coverage detected