mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
core/txpool/blobpool: improve AvailableBlobs
This commit is contained in:
parent
e8a5b1bd16
commit
485e14cb40
1 changed files with 3 additions and 7 deletions
|
|
@ -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.
|
||||
func (p *BlobPool) AvailableBlobs(vhashes []common.Hash) []bool {
|
||||
available := make([]bool, len(vhashes))
|
||||
p.lock.RLock()
|
||||
for i, vhash := range vhashes {
|
||||
// Retrieve the datastore item (in a short lock)
|
||||
p.lock.RLock()
|
||||
_, exists := p.lookup.storeidOfBlob(vhash)
|
||||
p.lock.RUnlock()
|
||||
if exists {
|
||||
available[i] = true
|
||||
}
|
||||
_, available[i] = p.lookup.storeidOfBlob(vhash)
|
||||
}
|
||||
p.lock.RUnlock()
|
||||
return available
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue