Skip to content

Commit

Permalink
pr comment: add comment about hash check
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Jan 16, 2025
1 parent b0be0ae commit 56dfe96
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/services/watch_btc_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,16 +638,15 @@ func (s *Service) validateUnbondingTxOutput(
return false, nil
}

// check if the discovered unbonding tx is the registered unbonding tx in babylon
registeredUnbondingTxBytes, parseErr := hex.DecodeString(delegation.UnbondingTx)
if parseErr != nil {
return false, fmt.Errorf("failed to decode unbonding tx: %w", parseErr)
}

registeredUnbondingTx, parseErr := bbn.NewBTCTxFromBytes(registeredUnbondingTxBytes)
if parseErr != nil {
return false, fmt.Errorf("failed to parse unbonding tx: %w", parseErr)
}

if registeredUnbondingTx.TxHash().String() != tx.TxHash().String() {
log.Debug().
Str("staking_tx", delegation.StakingTxHashHex).
Expand Down

0 comments on commit 56dfe96

Please sign in to comment.