aboutsummaryrefslogtreecommitdiffstats
path: root/trie/proof.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-09-28 18:40:44 +0800
committerGitHub <noreply@github.com>2016-09-28 18:40:44 +0800
commitf88bca7ba96a16e10b9feee453dbdb4f81962f34 (patch)
tree15f58419e13f75dc0dfa940be0b1a9f3930de34f /trie/proof.go
parent7a5843de318f4bf0e41ddaab2d690fbe6fd04099 (diff)
parentd4608ae0d2fc76ea1ba1d3a97033e60bab1f0d59 (diff)
downloadgo-tangerine-1.4.14.tar
go-tangerine-1.4.14.tar.gz
go-tangerine-1.4.14.tar.bz2
go-tangerine-1.4.14.tar.lz
go-tangerine-1.4.14.tar.xz
go-tangerine-1.4.14.tar.zst
go-tangerine-1.4.14.zip
Merge pull request #3055 from karalabe/release/1.4v1.4.14
Geth 1.4.14: What else should we rewrite?
Diffstat (limited to 'trie/proof.go')
-rw-r--r--trie/proof.go8
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.