diff --git a/types/rlp_unmarshal.go b/types/rlp_unmarshal.go index 3743a151a6..fef4710627 100644 --- a/types/rlp_unmarshal.go +++ b/types/rlp_unmarshal.go @@ -386,8 +386,12 @@ func (t *Transaction) UnmarshalRLP(input []byte) error { type rlpValues []*fastrlp.Value -func (r rlpValues) dequeueValue() *fastrlp.Value { - val := r[0] - r = r[1:] +func (r *rlpValues) dequeueValue() *fastrlp.Value { + if len(*r) == 0 { + return nil + } + val := (*r)[0] + *r = (*r)[1:] + return val }