mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
chore: refine wlock to rlock
This commit is contained in:
parent
a775e68421
commit
6ec9e6592b
1 changed files with 4 additions and 4 deletions
|
|
@ -474,8 +474,8 @@ func (pool *LegacyPool) stats() (int, int) {
|
||||||
// Content retrieves the data content of the transaction pool, returning all the
|
// 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.
|
// 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.Lock()
|
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 {
|
||||||
|
|
@ -516,8 +516,8 @@ func (pool *LegacyPool) Pending(filter txpool.PendingFilter) map[common.Address]
|
||||||
if filter.OnlyBlobTxs {
|
if filter.OnlyBlobTxs {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
pool.mu.Lock()
|
pool.mu.RLock()
|
||||||
defer pool.mu.Unlock()
|
defer pool.mu.RUnlock()
|
||||||
|
|
||||||
// Convert the new uint256.Int types to the old big.Int ones used by the legacy pool
|
// Convert the new uint256.Int types to the old big.Int ones used by the legacy pool
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue