Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Jan 23, 2025
1 parent cbfc36e commit 8527d48
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/services/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import (
func (s *Service) checkUnbondingOutputsForSpends(ctx context.Context) {
log.Info().Msg("Starting check for spent unbonding outputs...")
var (
pageToken = ""
pageToken = ""
totalUnbondedDelegations = 0
totalWithdrawnDelegations = 0
)

for {
Expand All @@ -29,6 +31,8 @@ func (s *Service) checkUnbondingOutputsForSpends(ctx context.Context) {
return
}

totalUnbondedDelegations += len(result.Data)

for _, delegation := range result.Data {
if delegation.UnbondingTx == nil {
log.Debug().
Expand Down Expand Up @@ -64,6 +68,7 @@ func (s *Service) checkUnbondingOutputsForSpends(ctx context.Context) {

withdrawnEvent := types.NewWithdrawnDelegationEvent(delegation.StakingTxHashHex)
utils.PushOrQuit(s.withdrawnDelegationChan, withdrawnEvent, s.quit)
totalWithdrawnDelegations++
}
}

Expand All @@ -73,5 +78,8 @@ func (s *Service) checkUnbondingOutputsForSpends(ctx context.Context) {
pageToken = result.PaginationToken
}

log.Info().Msg("Completed check for spent unbonding outputs")
log.Info().
Int("total_unbonded_delegations", totalUnbondedDelegations).
Int("total_withdrawn_delegations", totalWithdrawnDelegations).
Msg("Completed check for spent unbonding outputs")
}

0 comments on commit 8527d48

Please sign in to comment.