mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +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.
|
// 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))
|
||||||
|
p.lock.RLock()
|
||||||
for i, vhash := range vhashes {
|
for i, vhash := range vhashes {
|
||||||
// Retrieve the datastore item (in a short lock)
|
_, available[i] = p.lookup.storeidOfBlob(vhash)
|
||||||
p.lock.RLock()
|
|
||||||
_, exists := p.lookup.storeidOfBlob(vhash)
|
|
||||||
p.lock.RUnlock()
|
|
||||||
if exists {
|
|
||||||
available[i] = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
p.lock.RUnlock()
|
||||||
return available
|
return available
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue