Skip to content

Move to a Monitor-Update return from copying around ChannelMonitors #387

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

Closed
TheBlueMatt opened this issue Nov 4, 2019 · 3 comments
Closed
Milestone

Comments

@TheBlueMatt
Copy link
Collaborator

We may already have an issue for this, not sure, but opening in any case.

Currently, Channels keep a copy of their ChannelMonitors and any time we need to update it we copy the full thing out and hand it upwards. This sucks for performance, most of all because that monitor doesn't even get used eventually, it just gets merged in. We should be able to have some concept of a "Update" struct which we can pass up instead.

@TheBlueMatt
Copy link
Collaborator Author

I'm taking a look at this - I ended up kinda needing to do this because:
a) want to move Events into ChannelMonitors from the SimpleManyChannelMonitor to continue #474 as this makes it much easier to work with ChannelMonitors during rescan, but
b) leaving ChannelMonitors: Clone while holding events in them is super easy to misuse, as you may end up with multiple copies, with different pending events, or running events multiple times.

Ideally the solution is to implement this and then making ChannelMonitors not Clone at all, instead forcing the user to do something like clone_to_watchtower_mode or so.

@valentinewallace
Copy link
Contributor

closeable?

@TheBlueMatt
Copy link
Collaborator Author

Arguably #657 is the last step here, but I'll just close this and we can track it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants