Skip to content

Commit

Permalink
fix: ResubscribeToMissedBtcNotifications error
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab committed Dec 3, 2024
1 parent 1f0f728 commit 7fef454
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/config-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ btc:
retryinterval: 500ms
netparams: signet
bbn:
rpc-addr: https://rpc.devnet.babylonlabs.io:443
rpc-addr: https://rpc-dapp.devnet.babylonlabs.io:443
timeout: 30s
maxretrytimes: 5
retryinterval: 500ms
Expand Down
2 changes: 1 addition & 1 deletion config/config-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ btc:
retryinterval: 500ms
netparams: signet
bbn:
rpc-addr: https://rpc.devnet.babylonlabs.io:443
rpc-addr: https://rpc-dapp.devnet.babylonlabs.io:443
timeout: 30s
maxretrytimes: 5
retryinterval: 500ms
Expand Down
7 changes: 0 additions & 7 deletions internal/db/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,5 @@ func (db *Database) GetBTCDelegationsByStates(
return nil, err
}

if len(delegations) == 0 {
return nil, &NotFoundError{
Key: "specified states",
Message: "No BTC delegations found for the specified states",
}
}

return delegations, nil
}
2 changes: 1 addition & 1 deletion internal/services/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *Service) SubscribeToBbnEvents(ctx context.Context) {
// Resubscribe to missed BTC notifications
func (s *Service) ResubscribeToMissedBtcNotifications(ctx context.Context) {
go func() {
defer s.wg.Done()
log.Info().Msg("Resubscribing to missed BTC notifications")
delegations, err := s.db.GetBTCDelegationsByStates(ctx, []types.DelegationState{types.StateUnbonding, types.StateSlashed})
if err != nil {
log.Fatal().Msgf("Failed to get BTC delegations: %v", err)
Expand Down

0 comments on commit 7fef454

Please sign in to comment.