Skip to content

Commit

Permalink
fix listener on l2 [goreleaser]
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Jun 22, 2024
1 parent 99185a5 commit 4514e87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ethergo/listener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ func (c *chainListener) doPoll(parentCtx context.Context, handler HandleLog) (er
}

func (c chainListener) getBlockNumber(ctx context.Context) (uint64, error) {
block, err := c.client.BlockByNumber(ctx, big.NewInt(c.finalityMode.Int64()))
block, err := c.client.HeaderByNumber(ctx, big.NewInt(c.finalityMode.Int64()))
if err != nil {
return 0, fmt.Errorf("could not get block by number: %w", err)
}

blockNumber := block.Number()
blockNumber := block.Number

if c.blockWait > 0 {
blockNumber.Sub(blockNumber, big.NewInt(int64(c.blockWait)))
Expand Down

0 comments on commit 4514e87

Please sign in to comment.