aboutsummaryrefslogtreecommitdiffstats
path: root/trie/proof.go
diff options
context:
space:
mode:
Diffstat (limited to 'trie/proof.go')
-rw-r--r--trie/proof.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/trie/proof.go b/trie/proof.go
index 37a70fb34..5135de047 100644
--- a/trie/proof.go
+++ b/trie/proof.go
@@ -54,7 +54,7 @@ func (t *Trie) Prove(key []byte) []rlp.RawValue {
}
nodes = append(nodes, n)
case fullNode:
- tn = n[key[0]]
+ tn = n.Children[key[0]]
key = key[1:]
nodes = append(nodes, n)
case hashNode:
@@ -77,7 +77,7 @@ func (t *Trie) Prove(key []byte) []rlp.RawValue {
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.replaceChildren(n, nil)
+ n, _, _ = t.hasher.hashChildren(n, nil)
hn, _ := t.hasher.store(n, nil, false)
if _, ok := hn.(hashNode); ok || i == 0 {
// If the node's database encoding is a hash (or is the
@@ -103,7 +103,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(buf)
+ n, err := decodeNode(wantHash, buf)
if err != nil {
return nil, fmt.Errorf("bad proof node %d: %v", i, err)
}
@@ -139,7 +139,7 @@ func get(tn node, key []byte) ([]byte, node) {
tn = n.Val
key = key[len(n.Key):]
case fullNode:
- tn = n[key[0]]
+ tn = n.Children[key[0]]
key = key[1:]
case hashNode:
return key, n