From 177cab5fe70910ee0af3fcf493d51999ae2d923d Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 17 Oct 2016 16:13:50 +0200 Subject: trie: ensure resolved nodes stay loaded Commit 40cdcf1183 broke the optimisation which kept nodes resolved during Get in the trie. The decoder assigned cache generation 0 unconditionally, causing resolved nodes to get flushed on Commit. This commit fixes it and adds two tests. --- trie/proof.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'trie/proof.go') diff --git a/trie/proof.go b/trie/proof.go index f193b52df..bea5e5c09 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -101,7 +101,7 @@ func VerifyProof(rootHash common.Hash, key []byte, proof []rlp.RawValue) (value if !bytes.Equal(sha.Sum(nil), wantHash) { return nil, fmt.Errorf("bad proof node %d: hash mismatch", i) } - n, err := decodeNode(wantHash, buf) + n, err := decodeNode(wantHash, buf, 0) if err != nil { return nil, fmt.Errorf("bad proof node %d: %v", i, err) } -- cgit v1.2.3