Skip to content

Commit

Permalink
fix log
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Jan 15, 2025
1 parent 5cf16ab commit c283cef
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions internal/services/watch_btc_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,10 @@ func (s *Service) handleSpendingStakingTransaction(
// register unbonding spend notification
return s.registerUnbondingSpendNotification(ctx, delegation)
} else {
// the spending tx spends the unbonding path but the output is not valid
// we should log this case but no further action is needed.
registeredUnbondingTxBytes, parseErr := hex.DecodeString(delegation.UnbondingTx)
if parseErr != nil {
return fmt.Errorf("failed to decode unbonding tx: %w", parseErr)
}

registeredUnbondingTx, parseErr := bbn.NewBTCTxFromBytes(registeredUnbondingTxBytes)
if parseErr != nil {
return fmt.Errorf("failed to parse unbonding tx: %w", parseErr)
}
log.Error().
Str("staking_tx", delegation.StakingTxHashHex).
Str("spending_tx", spendingTx.TxHash().String()).
Str("spending_height", strconv.FormatUint(uint64(spendingHeight), 10)).
Str("registered_unbonding_tx", registeredUnbondingTx.TxHash().String()).
Msg("detected unexpected unbonding transaction")

return nil
Expand Down

0 comments on commit c283cef

Please sign in to comment.