core/txpool/blobpool: add read lock

This commit is contained in:
Gary Rong 2025-04-02 07:58:20 +08:00
parent 2a341854c7
commit d39b80e5c9

View file

@ -1244,6 +1244,9 @@ func (p *BlobPool) GetRLP(hash common.Hash) []byte {
// The size refers the length of the 'rlp encoding' of a blob transaction // The size refers the length of the 'rlp encoding' of a blob transaction
// including the attached blobs. // including the attached blobs.
func (p *BlobPool) GetMetadata(hash common.Hash) *txpool.TxMetadata { func (p *BlobPool) GetMetadata(hash common.Hash) *txpool.TxMetadata {
p.lock.RLock()
defer p.lock.RUnlock()
size, ok := p.lookup.sizeOfTx(hash) size, ok := p.lookup.sizeOfTx(hash)
if !ok { if !ok {
return nil return nil