Skip to content

Commit 94c8547

Browse files
committed
Return error on invalid RLP to handle test cases
1 parent 283cd88 commit 94c8547

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/state/snapshot/disklayer.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,8 @@ func (dl *diskLayer) account(hash common.Hash, ignoreStale bool) (*types.SlimAcc
8585
return nil, nil
8686
}
8787
account := new(types.SlimAccount)
88-
if err := rlp.DecodeBytes(data, account); err != nil {
89-
panic(err)
90-
}
91-
return account, nil
88+
err = rlp.DecodeBytes(data, account)
89+
return account, err
9290
}
9391

9492
// AccountRLP directly retrieves the account RLP associated with a particular

0 commit comments

Comments
 (0)