diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-09-28 17:53:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-28 17:53:54 +0800 |
commit | 437c3863f1917762e7f7474bd8b5c7ad78714d9c (patch) | |
tree | 154eb1fc771c9d809dc537a5ae45418263ad0770 /trie/proof.go | |
parent | 863d166c7b0250cf2e99c8aad69578cdd144d386 (diff) | |
parent | 710435b51b97b4c688b70bda35ab9d1aa704a988 (diff) | |
download | dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.gz dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.bz2 dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.lz dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.xz dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.zst dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.zip |
Merge pull request #3053 from karalabe/fjl-state-trie-journal
core, trie: replace state caches with trie journal
Diffstat (limited to 'trie/proof.go')
-rw-r--r-- | trie/proof.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/trie/proof.go b/trie/proof.go index 5135de047..116c13a1b 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -70,15 +70,13 @@ func (t *Trie) Prove(key []byte) []rlp.RawValue { panic(fmt.Sprintf("%T: invalid node: %v", tn, tn)) } } - if t.hasher == nil { - t.hasher = newHasher() - } + hasher := newHasher() proof := make([]rlp.RawValue, 0, len(nodes)) for i, n := range nodes { // Don't bother checking for errors here since hasher panics // if encoding doesn't work and we're not writing to any database. - n, _, _ = t.hasher.hashChildren(n, nil) - hn, _ := t.hasher.store(n, nil, false) + n, _, _ = hasher.hashChildren(n, nil) + hn, _ := hasher.store(n, nil, false) if _, ok := hn.(hashNode); ok || i == 0 { // If the node's database encoding is a hash (or is the // root node), it becomes a proof element. |