aboutsummaryrefslogtreecommitdiffstats
path: root/trie/proof.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-10-17 22:13:50 +0800
committerFelix Lange <fjl@twurst.com>2016-10-18 10:57:47 +0800
commit177cab5fe70910ee0af3fcf493d51999ae2d923d (patch)
tree54a8c78b9e2a25880b1d9cc284affad7d0830d33 /trie/proof.go
parent187d6a66a5176a1dc3e75d5ad4baad623762acb9 (diff)
downloadgo-tangerine-177cab5fe70910ee0af3fcf493d51999ae2d923d.tar.gz
go-tangerine-177cab5fe70910ee0af3fcf493d51999ae2d923d.tar.zst
go-tangerine-177cab5fe70910ee0af3fcf493d51999ae2d923d.zip
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.
Diffstat (limited to 'trie/proof.go')
-rw-r--r--trie/proof.go2
1 files changed, 1 insertions, 1 deletions
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)
}