projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b3d0a8d
)
Log when we change HTLC state while sending a commitment transaction
author
Matt Corallo
<git@bluematt.me>
Tue, 13 Jul 2021 16:07:01 +0000
(16:07 +0000)
committer
Matt Corallo
<git@bluematt.me>
Fri, 13 Aug 2021 21:54:50 +0000
(21:54 +0000)
lightning/src/ln/channel.rs
patch
|
blob
|
history
diff --git
a/lightning/src/ln/channel.rs
b/lightning/src/ln/channel.rs
index 9a5fd0422228e1e46f4bdd3d27c6cb1c246575a8..a1123a320f87d9ead4c4789643a11cfe0453373c 100644
(file)
--- a/
lightning/src/ln/channel.rs
+++ b/
lightning/src/ln/channel.rs
@@
-4462,6
+4462,7
@@
impl<Signer: Sign> Channel<Signer> {
}
/// Only fails in case of bad keys
fn send_commitment_no_status_check<L: Deref>(&mut self, logger: &L) -> Result<(msgs::CommitmentSigned, ChannelMonitorUpdate), ChannelError> where L::Target: Logger {
}
/// Only fails in case of bad keys
fn send_commitment_no_status_check<L: Deref>(&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.
// 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<Signer: Sign> Channel<Signer> {
Some(InboundHTLCState::AwaitingAnnouncedRemoteRevoke(forward_info.clone()))
} else { None };
if let Some(state) = new_state {
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;
}
}
htlc.state = state;
}
}
@@
-4477,12
+4479,14
@@
impl<Signer: Sign> Channel<Signer> {
if let Some(fail_reason) = if let &mut OutboundHTLCState::AwaitingRemoteRevokeToRemove(ref mut fail_reason) = &mut htlc.state {
Some(fail_reason.take())
} else { None } {
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());
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;
}
self.feerate_per_kw = feerate;
self.pending_update_fee = None;
}