From: Matt Corallo Date: Tue, 13 Jul 2021 16:07:01 +0000 (+0000) Subject: Log when we change HTLC state while sending a commitment transaction X-Git-Tag: v0.0.100~3^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=commitdiff_plain;h=01e8ff5ed85c1ecb890350829c9c250fd5f2a793 Log when we change HTLC state while sending a commitment transaction --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 9a5fd042..a1123a32 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -4462,6 +4462,7 @@ impl Channel { } /// Only fails in case of bad keys fn send_commitment_no_status_check(&mut self, logger: &L) -> Result<(msgs::CommitmentSigned, ChannelMonitorUpdate), ChannelError> where L::Target: Logger { + log_trace!(logger, "Updating HTLC state for a newly-sent commitment_signed..."); // We can upgrade the status of some HTLCs that are waiting on a commitment, even if we // fail to generate this, we still are at least at a position where upgrading their status // is acceptable. @@ -4470,6 +4471,7 @@ impl Channel { Some(InboundHTLCState::AwaitingAnnouncedRemoteRevoke(forward_info.clone())) } else { None }; if let Some(state) = new_state { + log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce {} to AwaitingAnnouncedRemoteRevoke", log_bytes!(htlc.payment_hash.0)); htlc.state = state; } } @@ -4477,12 +4479,14 @@ impl Channel { if let Some(fail_reason) = if let &mut OutboundHTLCState::AwaitingRemoteRevokeToRemove(ref mut fail_reason) = &mut htlc.state { Some(fail_reason.take()) } else { None } { + log_trace!(logger, " ...promoting outbound AwaitingRemoteRevokeToRemove {} to AwaitingRemovedRemoteRevoke", log_bytes!(htlc.payment_hash.0)); htlc.state = OutboundHTLCState::AwaitingRemovedRemoteRevoke(fail_reason); } } if let Some((feerate, update_state)) = self.pending_update_fee { if update_state == FeeUpdateState::AwaitingRemoteRevokeToAnnounce { debug_assert!(!self.is_outbound()); + log_trace!(logger, " ...promoting inbound AwaitingRemoteRevokeToAnnounce fee update {} to Committed", feerate); self.feerate_per_kw = feerate; self.pending_update_fee = None; }