Skip to content

Commit

Permalink
retry more
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Jan 6, 2025
1 parent 1a49a14 commit 54e6a8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions reporter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *Reporter) getHeaderMsgsToSubmit(signer string, ibs []*types.IndexedBloc
err = retrywrap.Do(func() error {
res, err = r.babylonClient.ContainsBTCBlock(&blockHash)

return err
return fmt.Errorf("error in contains block: %w", err)
},
retry.Delay(r.retrySleepTime),
retry.MaxDelay(r.maxRetrySleepTime),
Expand Down Expand Up @@ -79,14 +79,15 @@ func (r *Reporter) submitHeaderMsgs(msg *btclctypes.MsgInsertHeaders) error {
err := retrywrap.Do(func() error {
res, err := r.babylonClient.InsertHeaders(context.Background(), msg)
if err != nil {
return err
return fmt.Errorf("could not submit headers: %w", err)
}
r.logger.Infof("Successfully submitted %d headers to Babylon with response code %v", len(msg.Headers), res.Code)

return nil
},
retry.Delay(r.retrySleepTime),
retry.MaxDelay(r.maxRetrySleepTime),
bootstrapAttemptsAtt,
)
if err != nil {
r.metrics.FailedHeadersCounter.Add(float64(len(msg.Headers)))
Expand Down

0 comments on commit 54e6a8d

Please sign in to comment.