celestiaorg / smt

A Go library that implements a Sparse Merkle tree for a key-value map.
https://godoc.org/github.com/celestiaorg/smt
MIT License
138 stars 53 forks source link

sanityCheck: only necessarily calculate siblingHash if len(proof.SideNodes > 0 but also return early and unnest #56

Closed odeke-em closed 3 years ago

odeke-em commented 3 years ago

If we look at the code in here https://github.com/celestiaorg/smt/blob/a99c0f5249884312ab8e6864fe165371c0f461ba/proofs.go#L44-L54

Notice