Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Added error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii-4chain committed Jan 25, 2024
1 parent a011827 commit e1dfbab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion record_tx_strategy_outgoing_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ func (strategy *outgoingTx) Validate() error {
}

func (strategy *outgoingTx) TxID() string {
btTx, _ := bt.NewTxFromString(strategy.Hex)
btTx, err := bt.NewTxFromString(strategy.Hex)

// Return hex if hex is invalid. Handle error in error handlers
if err != nil {
return strategy.Hex
}
return btTx.TxID()
}

Expand Down

0 comments on commit e1dfbab

Please sign in to comment.