Skip to content

Commit 61f4b5a

Browse files
authored
accounts/abi/bind: fix gas price suggestion with pre EIP-1559 clients (ethereum#23102)
This fixes transaction sending in the case where an app using go-ethereum v1.10.4 is talking to a pre-EIP-1559 RPC node. In this case, the eth_maxPriorityFeePerGas endpoint is not available and we can only rely on eth_gasPrice.
1 parent 35dbf7a commit 61f4b5a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

accounts/abi/bind/base.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,10 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
256256
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
257257
}
258258
if opts.GasPrice == nil {
259-
price, err := c.transactor.SuggestGasTipCap(ensureContext(opts.Context))
259+
price, err := c.transactor.SuggestGasPrice(ensureContext(opts.Context))
260260
if err != nil {
261261
return nil, err
262262
}
263-
if head.BaseFee != nil {
264-
price.Add(price, head.BaseFee)
265-
}
266263
opts.GasPrice = price
267264
}
268265
}

0 commit comments

Comments
 (0)