From: Matt Corallo Date: Tue, 15 Jan 2019 01:37:06 +0000 (-0500) Subject: Log information about channel freeze/restore from monitor updates X-Git-Tag: v0.0.12~230^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2019-01-log-more;p=rust-lightning Log information about channel freeze/restore from monitor updates --- diff --git a/src/ln/channel.rs b/src/ln/channel.rs index abe01aa23..beab7ffc6 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -2373,6 +2373,8 @@ impl Channel { } } + log_trace!(self, "Regenerated latest commitment update with {} update_adds, {} update_fulfills, {} update_fails, and {} update_fail_malformeds", + update_add_htlcs.len(), update_fulfill_htlcs.len(), update_fail_htlcs.len(), update_fail_malformed_htlcs.len()); msgs::CommitmentUpdate { update_add_htlcs, update_fulfill_htlcs, update_fail_htlcs, update_fail_malformed_htlcs, update_fee: None, //TODO: We need to support re-generating any update_fees in the last commitment_signed! diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index 6cee5d694..23d5eb21f 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -457,6 +457,7 @@ macro_rules! handle_monitor_err { ($self: ident, $err: expr, $channel_state: expr, $entry: expr, $action_type: path, $resend_raa: expr, $resend_commitment: expr, $failed_forwards: expr, $failed_fails: expr) => { match $err { ChannelMonitorUpdateErr::PermanentFailure => { + log_error!($self, "Closing channel {} due to monitor update PermanentFailure", log_bytes!($entry.key()[..])); let (channel_id, mut chan) = $entry.remove_entry(); if let Some(short_id) = chan.get_short_channel_id() { $channel_state.short_to_id.remove(&short_id); @@ -474,6 +475,18 @@ macro_rules! handle_monitor_err { res }, ChannelMonitorUpdateErr::TemporaryFailure => { + log_info!($self, "Disabling channel {} due to monitor update TemporaryFailure. On restore will send {} and process {} forwards and {} fails", + log_bytes!($entry.key()[..]), + if $resend_commitment && $resend_raa { + match $action_type { + RAACommitmentOrder::CommitmentFirst => { "commitment then RAA" }, + RAACommitmentOrder::RevokeAndACKFirst => { "RAA then commitment" }, + } + } else if $resend_commitment { "commitment" } + else if $resend_raa { "RAA" } + else { "nothing" }, + (&$failed_forwards as &Vec<(PendingForwardHTLCInfo, u64)>).len(), + (&$failed_fails as &Vec<(HTLCSource, PaymentHash, HTLCFailReason)>).len()); if !$resend_commitment { debug_assert!($action_type == RAACommitmentOrder::RevokeAndACKFirst || !$resend_raa); }