Skip to content

Commit c332885

Browse files
committed
Log when we change HTLC state while sending a commitment transaction
1 parent 84031af commit c332885

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
@@ -4235,6 +4235,7 @@ impl<Signer: Sign> Channel<Signer> {
42354235
}
42364236
/// Only fails in case of bad keys
42374237
fn send_commitment_no_status_check<L: Deref>(&mut self, logger: &L) -> Result<(msgs::CommitmentSigned, ChannelMonitorUpdate), ChannelError> where L::Target: Logger {
4238+
log_trace!(logger, "Updating HTLC state for a newly-sent commitment_signed...");
42384239
// We can upgrade the status of some HTLCs that are waiting on a commitment, even if we
42394240
// fail to generate this, we still are at least at a position where upgrading their status
42404241
// is acceptable.
@@ -4243,19 +4244,22 @@ impl<Signer: Sign> Channel<Signer> {
42434244
Some(InboundHTLCState::AwaitingAnnouncedRemoteRevoke(forward_info.clone()))
42444245
} else { None };
42454246
if let Some(state) = new_state {
4247+
log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce {} to AwaitingAnnouncedRemoteRevoke", log_bytes!(htlc.payment_hash.0));
42464248
htlc.state = state;
42474249
}
42484250
}
42494251
for htlc in self.pending_outbound_htlcs.iter_mut() {
42504252
if let Some(fail_reason) = if let &mut OutboundHTLCState::AwaitingRemoteRevokeToRemove(ref mut fail_reason) = &mut htlc.state {
42514253
Some(fail_reason.take())
42524254
} else { None } {
4255+
log_trace!(logger, " ...promoting outbound AwaitingRemoteRevokeToRemove {} to AwaitingRemovedRemoteRevoke", log_bytes!(htlc.payment_hash.0));
42534256
htlc.state = OutboundHTLCState::AwaitingRemovedRemoteRevoke(fail_reason);
42544257
}
42554258
}
42564259
if !self.is_outbound() {
42574260
if let Some((feerate, update_state)) = self.pending_update_fee {
42584261
if update_state == InboundFeeUpdateState::AwaitingRemoteRevokeToAnnounce {
4262+
log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce fee update {} to Committed", feerate);
42594263
self.feerate_per_kw = feerate;
42604264
self.pending_update_fee = None;
42614265
}

0 commit comments

Comments
 (0)