-
Notifications
You must be signed in to change notification settings - Fork 409
Refactor ChannelManager handle functions into a Channel-closing macro #147
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
Merged
TheBlueMatt
merged 7 commits into
lightningdevkit:master
from
TheBlueMatt:2018-09-channelmanager-err-macro
Sep 5, 2018
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c578e4a
Add ChannelManager-specific HandleError type and macro to use it
TheBlueMatt 4afbc12
Refactor handle_open_channel to wrapper error handling function
8c709d1
Dont return an Err from Channel::get_accept_channel that can't fail
TheBlueMatt f60b5d9
Ensure Channel::new_from_req always returns an ErrorMessage on Err
TheBlueMatt 2202d13
Simplify secp_call! macro in ChannelManager
TheBlueMatt 7a234b6
Fill out IgnoreError actions in get_channel_announcement
TheBlueMatt a71abac
Move announcement_signatures handling into new force-close macro
TheBlueMatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm having a builder is great to simplify errors filling but I think it's force us to specify a method for each case as a71abac shows it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe, though I also don't want to have ErrBuilder::new().msg().action().needs_close() every time we want to return an Err cause then we spend all our charachters on a line on error handling :/. Not sure if there's a great solution here, really, but I'm open to patches to play around with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, c-lightning doesn't have a concept of general handle error like us.
Still not delighted by this design, but don't see better for now so will go ahead with this for channel refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, well nothing stopping us from cleaning up things with macros or flattening errors in a future PR.