Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not panic on attempting to force-close a subchannel #151

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dlc-manager/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ macro_rules! check_for_timed_out_channels {
let is_timed_out = timeout < $manager.time.unix_time_now();
if is_timed_out {
let sub_channel = if channel.is_sub_channel() {
unimplemented!();
error!("Force-closing subchannels is not supported; skipping closure.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more precise, what's not supported is force-closing timed out subchannels, but AFAIK we could force-close here if we wanted to.

In 10101 we probably want more control over triggering a force-close, so I think we just don't want to call check_for_timed_out_channels at all. I wonder if this feature of the library is actually useful for any consumer, since force-closing is often an expensive decision cc @Tibo-lg. AFAIK this timeout is not based on the refund timelock, so we're being overeager.

I agree with removing the unimplemented, but I would maybe just log on Debug or nothing at all.

continue;

// TODO: Implement subchannel force closing
// let s = get_sub_channel_in_state!(
// $manager,
// channel.channel_id,
Expand Down