Skip to content

Commit

Permalink
fix withdrawable event
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Jan 14, 2025
1 parent 5690568 commit f261ebe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/services/expiry_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ func (s *Service) checkExpiry(ctx context.Context) *types.Error {
fmt.Errorf("failed to update BTC delegation state to withdrawable: %w", err),
)
}
}

if err := s.emitWithdrawableDelegationEvent(ctx, delegation); err != nil {
return err
} else {
// This means the state transitioned to withdrawable so we need to emit the event
if err := s.emitWithdrawableDelegationEvent(ctx, delegation); err != nil {
return err
}
}

if err := s.db.DeleteExpiredDelegation(ctx, delegation.StakingTxHashHex); err != nil {
Expand Down

0 comments on commit f261ebe

Please sign in to comment.