Skip to content

Commit 372a520

Browse files
committed
Log transaction bytes on broadcast failure
1 parent 6a70348 commit 372a520

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/logger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub(crate) use lightning::util::logger::Logger;
2-
pub(crate) use lightning::{log_debug, log_error, log_info, log_trace};
2+
pub(crate) use lightning::{log_bytes, log_debug, log_error, log_info, log_trace};
33

44
use lightning::util::logger::{Level, Record};
55
use lightning::util::ser::Writer;

src/tx_broadcaster.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::logger::{log_debug, log_error, log_trace, Logger};
1+
use crate::logger::{log_bytes, log_debug, log_error, log_trace, Logger};
22

33
use lightning::chain::chaininterface::BroadcasterInterface;
4+
use lightning::util::ser::Writeable;
45

56
use esplora_client::AsyncClient as EsploraClient;
67

@@ -66,6 +67,11 @@ where
6667
tx.txid(),
6768
e
6869
);
70+
log_trace!(
71+
self.logger,
72+
"Failed broadcast transaction bytes: {}",
73+
log_bytes!(tx.encode())
74+
);
6975
}
7076
}
7177
}
@@ -76,6 +82,11 @@ where
7682
tx.txid(),
7783
e
7884
);
85+
log_trace!(
86+
self.logger,
87+
"Failed broadcast transaction bytes: {}",
88+
log_bytes!(tx.encode())
89+
);
7990
}
8091
},
8192
}

0 commit comments

Comments
 (0)