aboutsummaryrefslogtreecommitdiffstats
path: root/trie/trie.go
diff options
context:
space:
mode:
Diffstat (limited to 'trie/trie.go')
-rw-r--r--trie/trie.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/trie/trie.go b/trie/trie.go
index 30543c549..4284e30ad 100644
--- a/trie/trie.go
+++ b/trie/trie.go
@@ -433,12 +433,10 @@ func (t *Trie) resolveHash(n hashNode, prefix []byte) (node, error) {
cacheMissCounter.Inc(1)
hash := common.BytesToHash(n)
-
- enc, err := t.db.Node(hash)
- if err != nil || enc == nil {
- return nil, &MissingNodeError{NodeHash: hash, Path: prefix}
+ if node := t.db.node(hash, t.cachegen); node != nil {
+ return node, nil
}
- return mustDecodeNode(n, enc, t.cachegen), nil
+ return nil, &MissingNodeError{NodeHash: hash, Path: prefix}
}
// Root returns the root hash of the trie.