-
Notifications
You must be signed in to change notification settings - Fork 407
Notify users on channel close #695
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
Comments
Well, I wanted get notified when a channel is closed because I wanted to take a backup for current state (ChannelMonitor and ChannelManager) whenever a channel is open/closed. If I could inject the side effect (in this case disk I/O?) from outside and let RL takes care of the backing up, then there is no need for getting notifying it. If so, I think we shouldn't add new Event type unless there is any other use case for it. |
CC #685.
Note that if you meet the stated requirements for ManyChannelMonitor (namely, the "Note that any updates to a channel's monitor must be applied to each instance of the channel's monitor everywhere (including remote watchtowers) before this function returns." part), you should be just fine, with no need to care about when you go to sync to make sure you don't lose data (though if you never sync, bringing your ChannelManager back up later may force-close channels, as described at https://docs.rs/lightning/0.0.11/lightning/ln/channelmanager/struct.ChannelManagerReadArgs.html#structfield.channel_monitors). |
Ooooh, I see. Thanks, it took me a while to get my head on straight. I must understand in more detail but at least I'm now sure that I don't have to know exactly when the channel is closed. I now think having a |
Probably a great indication that our absent high-level "how do you think about these objects" documentation is a problem :).
If that's true, it's a bug. But it is the case that any time a ChannelMonitor is out of sync with the ChannelManager (including not present), we'll force-close the channel with the ChannelMonitor data.
You need to wait a little longer for that - the channel closing transactions need to be confirmed first. We desperately need an Event (or call to the ManyChannelMonitor) for that, too, but currently it's incredibly nontrivial to figure out when you can delete ChannelMonitor data. |
Fixed in #997. |
@joemphilips pointed out that the only way to know when a channel closes right now is by polling
list_channels
. Seems the best way to implement this would be adding a newEvent
for it.The text was updated successfully, but these errors were encountered: