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 jagdeep sidhu committed Oct 21, 2021
1 parent 2305671 commit 2944633
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 @@ -370,7 +370,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 2944633

Please sign in to comment.