core: simplify condition for tnx replacement in the pool

This commit is contained in:
hadv 2019-01-03 16:57:35 +07:00
parent ddaf48bf84
commit 2d6a07b798
No known key found for this signature in database
GPG key ID: EC2B318ACE3D164F

View file

@ -256,7 +256,7 @@ func (l *txList) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Tran
// Have to ensure that the new gas price is higher than the old gas // Have to ensure that the new gas price is higher than the old gas
// price as well as checking the percentage threshold to ensure that // price as well as checking the percentage threshold to ensure that
// this is accurate for low (Wei-level) gas price replacements // this is accurate for low (Wei-level) gas price replacements
if old.GasPrice().Cmp(tx.GasPrice()) >= 0 || threshold.Cmp(tx.GasPrice()) > 0 { if threshold.Cmp(tx.GasPrice()) >= 0 {
return false, nil return false, nil
} }
} }