From 8f6bb5c2483252581f7f1c304ceb368791ca2a7e Mon Sep 17 00:00:00 2001 From: Pratik Patil Date: Thu, 14 Sep 2023 09:48:30 +0530 Subject: [PATCH] added RLock on pool.pendingMu in validateTxBasics() (#1001) --- core/txpool/txpool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index 9da20cd763..82ee2fafa8 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -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)