This commit is contained in:
Kyrin 2025-10-17 00:08:22 +08:00 committed by GitHub
parent f90ed5c81f
commit 70744a2ccc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -457,7 +457,7 @@ func (pool *LegacyPool) stats() (int, int) {
// pending as well as queued transactions, grouped by account and sorted by nonce. // 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) { func (pool *LegacyPool) Content() (map[common.Address][]*types.Transaction, map[common.Address][]*types.Transaction) {
pool.mu.RLock() pool.mu.RLock()
defer pool.mu.Unlock() defer pool.mu.RUnlock()
pending := make(map[common.Address][]*types.Transaction, len(pool.pending)) pending := make(map[common.Address][]*types.Transaction, len(pool.pending))
for addr, list := range pool.pending { for addr, list := range pool.pending {
@ -493,7 +493,7 @@ func (pool *LegacyPool) Pending(filter txpool.PendingFilter) map[common.Address]
return nil return nil
} }
pool.mu.RLock() pool.mu.RLock()
defer pool.mu.Unlock() defer pool.mu.RUnlock()
pending := make(map[common.Address][]*txpool.LazyTransaction, len(pool.pending)) pending := make(map[common.Address][]*txpool.LazyTransaction, len(pool.pending))
for addr, list := range pool.pending { for addr, list := range pool.pending {