Skip to content

Ensure handle_announcement_signatures always has a ErrorAction #143

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

Conversation

TheBlueMatt
Copy link
Collaborator

@TheBlueMatt TheBlueMatt commented Aug 31, 2018

This + #134 should resolve #129 for BOLT 4, though it'll need another read-through pass. (+ a bonus)

let onion_keys = ChannelManager::construct_onion_keys(&self.secp_ctx, &route, &session_priv)?;
//TODO: This should return something other than HandleError, that's really intended for
//p2p-returns only.
let onion_keys = secp_call!(ChannelManager::construct_onion_keys(&self.secp_ctx, &route, &session_priv), "Pubkey along hop was maliciously selected", msgs::ErrorAction::IgnoreError);
Copy link

Choose a reason for hiding this comment

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

Why not extend HandleError further than p2p-returns, something like MarkNodeAsBad { node_id }, could be useful to nodes ban ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe, but best to have more Err types so that you don't end up having match arms that don't make sense in context. eg having a user call send_payment then matching the Err type and ending up with a SendErrMessage action (but they don't know where to send it) is nonsense. Maybe if the full set always makes sense in context but I'm skeptical that'll work out.

@TheBlueMatt TheBlueMatt merged commit 5fb2cc4 into lightningdevkit:master Sep 3, 2018
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

Successfully merging this pull request may close these issues.

Work through each BOLT and fill out error conditions
2 participants