core/txpool/blobpool: skip variable not needed

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-09-19 10:21:11 +02:00
parent 9e6c5c3683
commit c75fdd947e
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

@ -1379,15 +1379,12 @@ func (p *BlobPool) GetBlobs(vhashes []common.Hash, version byte, convert bool) (
} }
// Traverse the blobs in the transaction // Traverse the blobs in the transaction
for i, hash := range tx.BlobHashes() { for i, hash := range tx.BlobHashes() {
skip := false // if true, skip using null, but proceed
list, ok := indices[hash] list, ok := indices[hash]
if !ok { if !ok {
continue // non-interesting blob continue // non-interesting blob
} }
var pf []kzg4844.Proof var pf []kzg4844.Proof
if !convert && sidecar.Version != version { if convert || sidecar.Version == version {
skip = true // blob sidecar version mismatch, skip but proceed
} else {
switch version { switch version {
case types.BlobSidecarVersion0: case types.BlobSidecarVersion0:
if sidecar.Version == types.BlobSidecarVersion0 { if sidecar.Version == types.BlobSidecarVersion0 {
@ -1414,12 +1411,10 @@ func (p *BlobPool) GetBlobs(vhashes []common.Hash, version byte, convert bool) (
pf = cellProofs pf = cellProofs
} }
} }
if !skip { for _, index := range list {
for _, index := range list { blobs[index] = &sidecar.Blobs[i]
blobs[index] = &sidecar.Blobs[i] commitments[index] = sidecar.Commitments[i]
commitments[index] = sidecar.Commitments[i] proofs[index] = pf
proofs[index] = pf
}
} }
} }
filled[hash] = struct{}{} filled[hash] = struct{}{}