mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-29 17:57:36 +00:00
accounts/abi/bind: fix gas price suggestion with pre EIP-1559 clients (#23102)
This commit is contained in:
parent
26fe46c008
commit
3212ec319b
1 changed files with 1 additions and 4 deletions
|
|
@ -238,13 +238,10 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
|
|||
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
|
||||
}
|
||||
if opts.GasPrice == nil {
|
||||
price, err := c.transactor.SuggestGasTipCap(opts.Context)
|
||||
price, err := c.transactor.SuggestGasPrice(ensureContext(opts.Context))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if head.BaseFee != nil {
|
||||
price.Add(price, head.BaseFee)
|
||||
}
|
||||
opts.GasPrice = price
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue