diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 9202479274..0afb526dd2 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -514,8 +514,8 @@ func (pool *LegacyPool) SetIngressFilters(filters []txpool.IngressFilter) { // Content retrieves the data content of the transaction pool, returning all the // pending as well as queued transactions, grouped by account and sorted by nonce. func (pool *LegacyPool) Content() (map[common.Address][]*types.Transaction, map[common.Address][]*types.Transaction) { - pool.mu.Lock() - defer pool.mu.Unlock() + pool.mu.RLock() + defer pool.mu.RUnlock() pending := make(map[common.Address][]*types.Transaction, len(pool.pending)) for addr, list := range pool.pending { @@ -549,8 +549,8 @@ func (pool *LegacyPool) ContentFrom(addr common.Address) ([]*types.Transaction, // // OP-Stack addition. func (pool *LegacyPool) ToJournal() map[common.Address]types.Transactions { - pool.mu.Lock() - defer pool.mu.Unlock() + pool.mu.RLock() + defer pool.mu.RUnlock() txs := make(map[common.Address]types.Transactions, len(pool.pending)+len(pool.queue)) for addr, pending := range pool.pending { @@ -577,8 +577,8 @@ func (pool *LegacyPool) Pending(filter txpool.PendingFilter) map[common.Address] if filter.OnlyBlobTxs { return nil } - pool.mu.Lock() - defer pool.mu.Unlock() + pool.mu.RLock() + defer pool.mu.RUnlock() pending := make(map[common.Address][]*txpool.LazyTransaction, len(pool.pending)) for addr, list := range pool.pending {