Compare commits

..

1 Commits

Author SHA1 Message Date
0xmountaintop
438a9fb1d6 fix(sender): make sure gas price is above baseFee (#1531)
Co-authored-by: 0xmountaintop <0xmountaintop@users.noreply.github.com>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
Co-authored-by: colinlyguo <colinlyguo@users.noreply.github.com>
2024-11-21 14:14:08 +08:00
2 changed files with 5 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ import (
"runtime/debug"
)
var tag = "v4.4.77"
var tag = "v4.4.78"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {

View File

@@ -362,6 +362,10 @@ func (s *Sender) createReplacingTransaction(tx *gethTypes.Transaction, baseFee,
originalGasPrice := tx.GasPrice()
gasPrice := new(big.Int).Mul(originalGasPrice, escalateMultipleNum)
gasPrice = new(big.Int).Div(gasPrice, escalateMultipleDen)
baseFeeInt := new(big.Int).SetUint64(baseFee)
if gasPrice.Cmp(baseFeeInt) < 0 {
gasPrice = baseFeeInt
}
if gasPrice.Cmp(maxGasPrice) > 0 {
gasPrice = maxGasPrice
}