Skip to content

Commit

Permalink
fix listener on l2 [goreleaser] (#2774)
Browse files Browse the repository at this point in the history
Co-authored-by: Trajan0x <[email protected]>
  • Loading branch information
trajan0x and trajan0x authored Jun 22, 2024
1 parent 99185a5 commit 719dcf3
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 719dcf3

Please sign in to comment.