Skip to content

Commit

Permalink
accounts/abi/bind: fix error handling in baseFee query (ethereum#23781)
Browse files Browse the repository at this point in the history
This fixes a panic that occurs when HeaderByNumber() returns an error.
  • Loading branch information
kibgzr authored and gzliudan committed Oct 18, 2024
1 parent b2c727f commit efb59fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
rawTx, err = c.createLegacyTx(opts, contract, input)
} else {
// Only query for basefee if gasPrice not specified
if head, errHead := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil); err != nil {
if head, errHead := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil); errHead != nil {
return nil, errHead
} else if head.BaseFee != nil {
rawTx, err = c.createDynamicTx(opts, contract, input, head)
Expand Down

0 comments on commit efb59fb

Please sign in to comment.