all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994)

This commit is contained in:
Felix Lange
2023-08-24 11:47:42 +03:00
committed by GitHub
parent 60ec41ce73
commit 9b46986edc
9 changed files with 13 additions and 17 deletions
+1 -2
View File
@@ -17,7 +17,6 @@
package light
import (
"bytes"
"context"
"errors"
"math/big"
@@ -126,7 +125,7 @@ func GetBody(ctx context.Context, odr OdrBackend, hash common.Hash, number uint6
return nil, err
}
body := new(types.Body)
if err := rlp.Decode(bytes.NewReader(data), body); err != nil {
if err := rlp.DecodeBytes(data, body); err != nil {
return nil, err
}
return body, nil