Skip to content

Commit

Permalink
add tx hex to error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
shamardy committed Jul 17, 2023
1 parent 986f970 commit 3f11705
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions mm2src/coins/utxo/utxo_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3127,11 +3127,12 @@ pub async fn tx_details_by_hash<T: UtxoCommonOps>(

let prev_output_index: usize = try_s!(input.previous_output.index.try_into());
let prev_tx_output = prev_tx.outputs.get(prev_output_index).ok_or(ERRL!(
"Previous output index is out of bound: coin={}, prev_output_index={}, prev_tx_hash={}, tx_hash={}",
"Previous output index is out of bound: coin={}, prev_output_index={}, prev_tx_hash={}, tx_hash={}, tx_hex={:02x}",
ticker,
prev_output_index,
prev_tx_hash,
hash
hash,
verbose_tx.hex,
))?;
input_amount += prev_tx_output.value;
let from: Vec<Address> = try_s!(coin.addresses_from_script(&prev_tx_output.script_pubkey.clone().into()));
Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/utxo/utxo_common/utxo_tx_history_v2_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ where
})?;
let prev_tx_output = prev_tx.outputs.get(prev_output_index).ok_or_else(|| {
UtxoTxDetailsError::Internal(format!(
"Previous output index is out of bound: coin={}, prev_output_index={}, prev_tx_hash={}, tx_hash={}",
ticker, prev_output_index, prev_tx_hash, params.hash
"Previous output index is out of bound: coin={}, prev_output_index={}, prev_tx_hash={}, tx_hash={}, tx_hex={:02x}",
ticker, prev_output_index, prev_tx_hash, params.hash, verbose_tx.hex
))
})?;

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_swap/taker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl TakerSavedSwap {
Some(event) => match &event.event {
TakerSwapEvent::Negotiated(neg) => {
let Some(key) = neg.maker_coin_htlc_pubkey else {
return ERR!("maker's pubkey is empty");
return ERR!("maker's pubkey is empty");
};
key.to_string()
},
Expand Down

0 comments on commit 3f11705

Please sign in to comment.