-
Notifications
You must be signed in to change notification settings - Fork 368
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
Prune monitors with zero claimable balances upon persisting #2236
Comments
Hmm, so I think its safe as long as (a) the channel is closed (ie channelmanager doesnt know about it) and (b) the balances are empty, at least what's what we've been telling users. We should, however, actually make use of this in our |
I guess actually with the exception of 0confs where the funding may not be confirmed but the channel closed? Is there a bug there? |
Actually, it looks like we always push a
|
Nice okay, good to know. Yea, I don't think we need to change that, I mean its dumb that we'll hang around to a monitor until our peer claims their money, but its easier than running the risk of removing a monitor too early before the channel is closed? So I think this issue should just be re-titled to refer to actually using this in the persister? |
Yeah. We'll still need a way to clean up timed out funding attempts, otherwise we'll always hold on to their |
Note that async monitor updates will also throw a wrinkle into this - #2167 (comment) |
There's also another case pointed out here: when a revoked commitment confirms and the counterparty claims all of the outputs, we still keep the claimable balances around preventing us from pruning. |
To summarize, aside from the one async monitor update issue linked above (ie only an issue for those returning |
Currently, users can decide to prune their
ChannelMonitor
s if a call toget_claimable_balances
returns empty. This is only safe to do so in certain scenarios though, as we can also return empty if the channel is either still unconfirmed or it has confirmed but we don't have ato_self
balance (like in the case of an inbound channel) and no HTLCs are present in our latest commitment transaction.The text was updated successfully, but these errors were encountered: