Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Dec 10, 2024
1 parent 5ad178b commit badc1fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/services/watch_btc_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ func (s *Service) handleSpendingStakingTransaction(
return fmt.Errorf("failed to validate withdrawal tx: %w", withdrawalErr)
}

// Try to validate as slashing transaction
if err := s.validateSlashingTxFromStaking(spendingTx, spendingInputIdx, delegation, params); err != nil {
if errors.Is(err, types.ErrInvalidSlashingTx) {
// Neither withdrawal nor slashing - this is an invalid spend
return fmt.Errorf("transaction is neither valid unbonding, withdrawal, nor slashing: %w", err)
}
return fmt.Errorf("failed to validate slashing tx: %w", err)
}
// // Try to validate as slashing transaction
// if err := s.validateSlashingTxFromStaking(spendingTx, spendingInputIdx, delegation, params); err != nil {
// if errors.Is(err, types.ErrInvalidSlashingTx) {
// // Neither withdrawal nor slashing - this is an invalid spend
// return fmt.Errorf("transaction is neither valid unbonding, withdrawal, nor slashing: %w", err)
// }
// return fmt.Errorf("failed to validate slashing tx: %w", err)
// }
return nil
}

Expand Down

0 comments on commit badc1fc

Please sign in to comment.