mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
add comments
This commit is contained in:
parent
2824f3ce6d
commit
3eb09d06c1
1 changed files with 25 additions and 22 deletions
|
|
@ -312,19 +312,23 @@ func (tx *BlobTx) decode(input []byte) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the bLen is equal to the length of the input, it means that the sidecar is not present.
|
||||||
|
if len(input) == bLen {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type sidecarNoVersion struct {
|
type sidecarNoVersion struct {
|
||||||
Blobs []kzg4844.Blob // Blobs needed by the blob pool
|
Blobs []kzg4844.Blob // Blobs needed by the blob pool
|
||||||
Commitments []kzg4844.Commitment // Commitments needed by the blob pool
|
Commitments []kzg4844.Commitment // Commitments needed by the blob pool
|
||||||
Proofs []kzg4844.Proof // Proofs needed by the blob pool
|
Proofs []kzg4844.Proof // Proofs needed by the blob pool
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the input is shorter than the RLP-encoded transaction, it means
|
// Decode the sidecar, which may or may not have a version byte.
|
||||||
// that the transaction does not have a sidecar.
|
|
||||||
if input = input[bLen:]; len(input) > 0 {
|
|
||||||
var (
|
var (
|
||||||
version = byte(0)
|
version = byte(0)
|
||||||
sidecar = sidecarNoVersion{}
|
sidecar = sidecarNoVersion{}
|
||||||
)
|
)
|
||||||
|
input = input[bLen:]
|
||||||
kind, content, _, err := rlp.Split(input)
|
kind, content, _, err := rlp.Split(input)
|
||||||
// If the first element is a byte, it means that the sidecar version is encoded.
|
// If the first element is a byte, it means that the sidecar version is encoded.
|
||||||
if kind == rlp.Byte {
|
if kind == rlp.Byte {
|
||||||
|
|
@ -342,7 +346,6 @@ func (tx *BlobTx) decode(input []byte) error {
|
||||||
Commitments: sidecar.Commitments,
|
Commitments: sidecar.Commitments,
|
||||||
Proofs: sidecar.Proofs,
|
Proofs: sidecar.Proofs,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue