Skip to content

Commit

Permalink
added RLock on pool.pendingMu in validateTxBasics()
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikspatil024 committed Sep 12, 2023
1 parent a02374e commit 770f542
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,9 @@ func (pool *TxPool) validateTxBasics(tx *types.Transaction, local bool) error {
// return core.ErrInsufficientFunds
// }
// Verify that replacing transactions will not result in overdraft
pool.pendingMu.RLock()
defer pool.pendingMu.RUnlock()

list := pool.pending[from]
if list != nil { // Sender already has pending txs
sum := new(big.Int).Add(tx.Cost(), list.totalcost)
Expand Down

0 comments on commit 770f542

Please sign in to comment.