all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994)
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user