Skip to content

Commit

Permalink
chore: Disable force-closing timed out dlc channels
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis committed Feb 12, 2024
1 parent ba68a7b commit 7ce2911
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions dlc-manager/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ macro_rules! check_for_timed_out_channels {
if let SignedChannelState::$state { timeout, .. } = channel.state {
let is_timed_out = timeout < $manager.time.unix_time_now();
if is_timed_out {
let sub_channel = if channel.is_sub_channel() {
let sub_channel: Option<SubChannel> = if channel.is_sub_channel() {
log::info!(
"Skipping force-closure of subchannel {}: not supported",
bitcoin::hashes::hex::ToHex::to_hex(&channel.channel_id[..])
Expand All @@ -148,11 +148,18 @@ macro_rules! check_for_timed_out_channels {
None
};

log::warn!("Force closing channel that timed out. {} < {}", timeout, $manager.time.unix_time_now());
match $manager.force_close_channel_internal(channel, sub_channel, true) {
Err(e) => error!("Error force closing channel {}", e),
_ => {}
}
log::warn!(
"Dlc channel timed out in State {:?}. Skipping force-closure of dlc channel {} while in beta.",
channel.state,
bitcoin::hashes::hex::ToHex::to_hex(&channel.channel_id[..])
);

// TODO(holzeis): Enable that logic once out of beta!
// log::warn!("Force closing channel that timed out. {} < {}", timeout, $manager.time.unix_time_now());
// match $manager.force_close_channel_internal(channel, sub_channel, true) {
// Err(e) => error!("Error force closing channel {}", e),
// _ => {}
// }
}
}
}
Expand Down

0 comments on commit 7ce2911

Please sign in to comment.