Skip to content

Commit

Permalink
Log transaction bytes on broadcast failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Dec 4, 2023
1 parent 6a70348 commit 372a520
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/logger.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub(crate) use lightning::util::logger::Logger;
pub(crate) use lightning::{log_debug, log_error, log_info, log_trace};
pub(crate) use lightning::{log_bytes, log_debug, log_error, log_info, log_trace};

use lightning::util::logger::{Level, Record};
use lightning::util::ser::Writer;
Expand Down
13 changes: 12 additions & 1 deletion src/tx_broadcaster.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::logger::{log_debug, log_error, log_trace, Logger};
use crate::logger::{log_bytes, log_debug, log_error, log_trace, Logger};

use lightning::chain::chaininterface::BroadcasterInterface;
use lightning::util::ser::Writeable;

use esplora_client::AsyncClient as EsploraClient;

Expand Down Expand Up @@ -66,6 +67,11 @@ where
tx.txid(),
e
);
log_trace!(
self.logger,
"Failed broadcast transaction bytes: {}",
log_bytes!(tx.encode())
);
}
}
}
Expand All @@ -76,6 +82,11 @@ where
tx.txid(),
e
);
log_trace!(
self.logger,
"Failed broadcast transaction bytes: {}",
log_bytes!(tx.encode())
);
}
},
}
Expand Down

0 comments on commit 372a520

Please sign in to comment.