Skip to content
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

panic potential: htlc_accepted hook may have some fields not set #541

Open
JssDWt opened this issue Nov 18, 2024 · 0 comments
Open

panic potential: htlc_accepted hook may have some fields not set #541

JssDWt opened this issue Nov 18, 2024 · 0 comments
Assignees

Comments

@JssDWt
Copy link
Collaborator

JssDWt commented Nov 18, 2024

The following fields might not be set in the htlc_accepted hook:

forward_msat: Amount,
outgoing_cltv_value: u32,
#[serde(deserialize_with = "from_hex")]
shared_secret: Vec<u8>,
#[serde(deserialize_with = "from_hex")]
next_onion: Vec<u8>,

These should all be wrapped in Option<_>

unwrap is called on deserialization here: https://github.com/JssDWt/greenlight/blob/5dc32eb0d7163c5946cd9f58e698168fd0a1652d/libs/gl-plugin/src/lsp.rs#L55

This may cause panicks deserializing the htlc_accepted payload.

@nepet nepet self-assigned this Nov 19, 2024
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