@@ -230,9 +230,6 @@ type LegacyPool struct {
230
230
signer types.Signer
231
231
mu sync.RWMutex
232
232
233
- // [currentStateLock] is required to allow concurrent access to address nonces
234
- // and balances during reorgs and gossip handling.
235
- currentStateLock sync.Mutex
236
233
// closed when the transaction pool is stopped. Any goroutine can listen
237
234
// to this to be notified if it should shut down.
238
235
generalShutdownChan chan struct {}
@@ -688,9 +685,6 @@ func (pool *LegacyPool) validateTxBasics(tx *types.Transaction, local bool) erro
688
685
// validateTx checks whether a transaction is valid according to the consensus
689
686
// rules and adheres to some heuristic limits of the local node (price and size).
690
687
func (pool * LegacyPool ) validateTx (tx * types.Transaction , local bool ) error {
691
- pool .currentStateLock .Lock ()
692
- defer pool .currentStateLock .Unlock ()
693
-
694
688
opts := & txpool.ValidationOptionsWithState {
695
689
State : pool .currentState ,
696
690
Rules : pool .chainconfig .Rules (
@@ -1503,9 +1497,7 @@ func (pool *LegacyPool) reset(oldHead, newHead *types.Header) {
1503
1497
return
1504
1498
}
1505
1499
pool .currentHead .Store (newHead )
1506
- pool .currentStateLock .Lock ()
1507
1500
pool .currentState = statedb
1508
- pool .currentStateLock .Unlock ()
1509
1501
pool .pendingNonces = newNoncer (statedb )
1510
1502
1511
1503
// when we reset txPool we should explicitly check if fee struct for min base fee has changed
@@ -1529,9 +1521,6 @@ func (pool *LegacyPool) reset(oldHead, newHead *types.Header) {
1529
1521
// future queue to the set of pending transactions. During this process, all
1530
1522
// invalidated transactions (low nonce, low balance) are deleted.
1531
1523
func (pool * LegacyPool ) promoteExecutables (accounts []common.Address ) []* types.Transaction {
1532
- pool .currentStateLock .Lock ()
1533
- defer pool .currentStateLock .Unlock ()
1534
-
1535
1524
// Track the promoted transactions to broadcast them at once
1536
1525
var promoted []* types.Transaction
1537
1526
@@ -1738,9 +1727,6 @@ func (pool *LegacyPool) truncateQueue() {
1738
1727
// is always explicitly triggered by SetBaseFee and it would be unnecessary and wasteful
1739
1728
// to trigger a re-heap is this function
1740
1729
func (pool * LegacyPool ) demoteUnexecutables () {
1741
- pool .currentStateLock .Lock ()
1742
- defer pool .currentStateLock .Unlock ()
1743
-
1744
1730
// Iterate over all accounts and demote any non-executable transactions
1745
1731
gasLimit := pool .currentHead .Load ().GasLimit
1746
1732
for addr , list := range pool .pending {
0 commit comments