Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Apr 5, 2024
1 parent 17c5e4c commit 6810f10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ethreceipts/ethreceipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,16 +813,21 @@ func (l *ReceiptsListener) latestBlockNum() *big.Int {
func getChainID(ctx context.Context, provider ethrpc.Interface) (*big.Int, error) {
var chainID *big.Int
err := breaker.Do(ctx, func() error {
ctx, cancel := context.WithTimeout(ctx, 4*time.Second)
defer cancel()

id, err := provider.ChainID(ctx)
if err != nil {
return err
}
chainID = id
return nil
}, nil, 1*time.Second, 2, 20)
}, nil, 1*time.Second, 2, 3)

if err != nil {
return nil, err
}

return chainID, nil
}

Expand Down

0 comments on commit 6810f10

Please sign in to comment.