Skip to content

Commit 16c2d5b

Browse files
committed
Log when we change HTLC state while sending a commitment transaction
1 parent fe9d012 commit 16c2d5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4295,6 +4295,7 @@ impl<Signer: Sign> Channel<Signer> {
42954295
}
42964296
/// Only fails in case of bad keys
42974297
fn send_commitment_no_status_check<L: Deref>(&mut self, logger: &L) -> Result<(msgs::CommitmentSigned, ChannelMonitorUpdate), ChannelError> where L::Target: Logger {
4298+
log_trace!(logger, "Updating HTLC state for a newly-sent commitment_signed...");
42984299
// We can upgrade the status of some HTLCs that are waiting on a commitment, even if we
42994300
// fail to generate this, we still are at least at a position where upgrading their status
43004301
// is acceptable.
@@ -4303,19 +4304,22 @@ impl<Signer: Sign> Channel<Signer> {
43034304
Some(InboundHTLCState::AwaitingAnnouncedRemoteRevoke(forward_info.clone()))
43044305
} else { None };
43054306
if let Some(state) = new_state {
4307+
log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce {} to AwaitingAnnouncedRemoteRevoke", log_bytes!(htlc.payment_hash.0));
43064308
htlc.state = state;
43074309
}
43084310
}
43094311
for htlc in self.pending_outbound_htlcs.iter_mut() {
43104312
if let Some(fail_reason) = if let &mut OutboundHTLCState::AwaitingRemoteRevokeToRemove(ref mut fail_reason) = &mut htlc.state {
43114313
Some(fail_reason.take())
43124314
} else { None } {
4315+
log_trace!(logger, " ...promoting outbound AwaitingRemoteRevokeToRemove {} to AwaitingRemovedRemoteRevoke", log_bytes!(htlc.payment_hash.0));
43134316
htlc.state = OutboundHTLCState::AwaitingRemovedRemoteRevoke(fail_reason);
43144317
}
43154318
}
43164319
if !self.is_outbound() {
43174320
if let Some((feerate, update_state)) = self.pending_update_fee {
43184321
if update_state == InboundFeeUpdateState::AwaitingRemoteRevokeToAnnounce {
4322+
log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce fee update {} to Committed", feerate);
43194323
self.feerate_per_kw = feerate;
43204324
self.pending_update_fee = None;
43214325
}

0 commit comments

Comments
 (0)