aboutsummaryrefslogtreecommitdiffstats
path: root/trie/proof.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-12-01 19:28:26 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-12-01 19:28:26 +0800
commit96d86740a1d27d548cba4fffd22d3b85a6975c4d (patch)
tree2f1c94790089a9dff935e434d6985a8bd8ad1c44 /trie/proof.go
parent23031b1554a05817ac23f2ef0d4780e16f065663 (diff)
parent52904ae32f0a591e7dccad7827ff1c2a73c27026 (diff)
downloaddexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.tar
dexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.tar.gz
dexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.tar.bz2
dexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.tar.lz
dexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.tar.xz
dexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.tar.zst
dexon-96d86740a1d27d548cba4fffd22d3b85a6975c4d.zip
Merge pull request #2005 from zsfelfoldi/light-trie
Trie error handling
Diffstat (limited to 'trie/proof.go')
-rw-r--r--trie/proof.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/trie/proof.go b/trie/proof.go
index a705c49db..2e88bb50b 100644
--- a/trie/proof.go
+++ b/trie/proof.go
@@ -7,6 +7,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto/sha3"
+ "github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/rlp"
)
@@ -39,7 +41,14 @@ func (t *Trie) Prove(key []byte) []rlp.RawValue {
case nil:
return nil
case hashNode:
- tn = t.resolveHash(n)
+ var err error
+ tn, err = t.resolveHash(n, nil, nil)
+ if err != nil {
+ if glog.V(logger.Error) {
+ glog.Errorf("Unhandled trie error: %v", err)
+ }
+ return nil
+ }
default:
panic(fmt.Sprintf("%T: invalid node: %v", tn, tn))
}