core: avoid double-lock in tx_pool_test (#20984)

This commit is contained in:
Boqin Qin 2020-05-06 21:47:59 +08:00 committed by GitHub
parent 234cc8e77f
commit 39c64d85a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,7 +117,7 @@ func validateTxPoolInternals(pool *TxPool) error {
last = nonce last = nonce
} }
} }
if nonce := pool.Nonce(addr); nonce != last+1 { if nonce := pool.pendingNonces.get(addr); nonce != last+1 {
return fmt.Errorf("pending nonce mismatch: have %v, want %v", nonce, last+1) return fmt.Errorf("pending nonce mismatch: have %v, want %v", nonce, last+1)
} }
} }