From 2684b0ef2e10ed20784b9e854ceec71ab076c254 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Fri, 17 Oct 2025 10:37:44 +0800 Subject: [PATCH] Change lock mechanism to read lock for Content method --- core/txpool/legacypool/legacypool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index c2eec33623..d4cce9b5b8 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -456,8 +456,8 @@ func (pool *LegacyPool) stats() (int, int) { // 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 {