core/txpool/blobpool: improve AvailableBlobs

This commit is contained in:
Felix Lange 2026-05-21 09:02:23 +02:00
parent e8a5b1bd16
commit 485e14cb40

View file

@ -1698,15 +1698,11 @@ func (p *BlobPool) GetBlobs(vhashes []common.Hash, version byte) ([]*kzg4844.Blo
// AvailableBlobs returns whether the blobs are available in the subpool. // AvailableBlobs returns whether the blobs are available in the subpool.
func (p *BlobPool) AvailableBlobs(vhashes []common.Hash) []bool { func (p *BlobPool) AvailableBlobs(vhashes []common.Hash) []bool {
available := make([]bool, len(vhashes)) available := make([]bool, len(vhashes))
for i, vhash := range vhashes {
// Retrieve the datastore item (in a short lock)
p.lock.RLock() p.lock.RLock()
_, exists := p.lookup.storeidOfBlob(vhash) for i, vhash := range vhashes {
_, available[i] = p.lookup.storeidOfBlob(vhash)
}
p.lock.RUnlock() p.lock.RUnlock()
if exists {
available[i] = true
}
}
return available return available
} }