forked from cerc-io/ipld-eth-server
for some reason every now and then a branch node would throw a panic here; still need to figure out why; quick fix
This commit is contained in:
parent
b2d5345c02
commit
f81c440418
@ -56,8 +56,7 @@ func decodeTrieNode(c cid.Cid, b []byte,
|
|||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
err = rlp.DecodeBytes(b, &i)
|
if err = rlp.DecodeBytes(b, &i); err != nil {
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +139,12 @@ func parseTrieNodeBranch(i []interface{}, codec uint64) ([]interface{}, error) {
|
|||||||
var out []interface{}
|
var out []interface{}
|
||||||
|
|
||||||
for _, vi := range i {
|
for _, vi := range i {
|
||||||
v := vi.([]byte)
|
v, ok := vi.([]byte)
|
||||||
|
// Sometimes this throws "panic: interface conversion: interface {} is []interface {}, not []uint8"
|
||||||
|
// Figure out why, and if it is okay to continue
|
||||||
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
switch len(v) {
|
switch len(v) {
|
||||||
case 0:
|
case 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user