From 8b75502915cbdf83515c3e7c12c4a1cbec43c5e9 Mon Sep 17 00:00:00 2001 From: Ilya Raykker Date: Fri, 27 Sep 2024 13:44:04 +0200 Subject: [PATCH] And more debug output --- iavl/node.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iavl/node.go b/iavl/node.go index 13749af8b..101bd8442 100644 --- a/iavl/node.go +++ b/iavl/node.go @@ -136,7 +136,10 @@ func MakeNode(nk, buf []byte) (*Node, error) { // ensure take the hash for the leaf node node._hash(node.nodeKey.version) } else { // Read children. + fmt.Printf("MAKENODE BUF: %+v\n, ", buf) + fmt.Printf("MAKENODE HASH WAS: %+v, ", node.hash) node.hash, n, err = encoding.DecodeBytes(buf) + fmt.Printf("BECOME: %+v\n", node.hash) if err != nil { return nil, fmt.Errorf("decoding node.hash, %w", err) } @@ -426,6 +429,7 @@ func (node *Node) getByIndex(t *ImmutableTree, index int64) (key []byte, value [ // called on nodes which have descendant node hashes already computed. func (node *Node) _hash(version int64) []byte { if node.hash != nil { + fmt.Printf("_HASH IS NOT NIL: %+v\n", node.hash) return node.hash } @@ -434,6 +438,7 @@ func (node *Node) _hash(version int64) []byte { return nil } node.hash = h.Sum(nil) + fmt.Printf("FINAL _HASH IS: %+v\n", node.hash) return node.hash }