added RLock on pool.pendingMu in validateTxBasics() (#1001)

This commit is contained in:
Pratik Patil 2023-09-14 09:48:30 +05:30 committed by GitHub
parent 1f9c6bb045
commit 8f6bb5c248
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)