Unverified Commit 33e23ee3 authored by Saman H. Pasha's avatar Saman H. Pasha Committed by GitHub

accounts/abi.bind: don't fetch head in transact unless required (#25988)

If GasFeeCap and GasTipCap are specified, we don't need to retrieve the head block for constructing a transaction
parent 6d559083
......@@ -373,6 +373,8 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
)
if opts.GasPrice != nil {
rawTx, err = c.createLegacyTx(opts, contract, input)
} else if opts.GasFeeCap != nil && opts.GasTipCap != nil {
rawTx, err = c.createDynamicTx(opts, contract, input, nil)
} else {
// Only query for basefee if gasPrice not specified
if head, errHead := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil); errHead != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment