mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-01 20:48:38 +00:00
core/txpool/blobpool: use SplitUint64 instead of SplitString
This commit is contained in:
parent
a3f088edcf
commit
d1a0c5cd95
1 changed files with 3 additions and 11 deletions
|
|
@ -233,19 +233,11 @@ func encodeForNetwork(storedRLP []byte) ([]byte, error) {
|
||||||
txRLP := txBytes[1:]
|
txRLP := txBytes[1:]
|
||||||
|
|
||||||
// 2. Find the version of sidecar.
|
// 2. Find the version of sidecar.
|
||||||
version, _, err := rlp.SplitString(elems[1])
|
version, _, err := rlp.SplitUint64(elems[1])
|
||||||
if err != nil {
|
if err != nil || version > 255 {
|
||||||
return nil, fmt.Errorf("invalid version: %w", err)
|
return nil, fmt.Errorf("invalid version: %w", err)
|
||||||
}
|
}
|
||||||
var versionByte byte
|
versionByte := byte(version)
|
||||||
switch len(version) {
|
|
||||||
case 0:
|
|
||||||
versionByte = 0
|
|
||||||
case 1:
|
|
||||||
versionByte = version[0]
|
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("invalid version length: %d", len(version))
|
|
||||||
}
|
|
||||||
// 3. Extract sidecar elements.
|
// 3. Extract sidecar elements.
|
||||||
commitmentsRLP := elems[2]
|
commitmentsRLP := elems[2]
|
||||||
proofsRLP := elems[3]
|
proofsRLP := elems[3]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue