Blockstream / greenlight

Build apps using self-custodial lightning nodes in the cloud
https://blockstream.github.io/greenlight/getting-started/
MIT License
117 stars 26 forks source link

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

Closed JssDWt closed 10 hours ago

JssDWt commented 1 week ago

The following fields might not be set in the htlc_accepted hook: https://github.com/Blockstream/greenlight/blob/2cd4d07e5d850f8e80357540c2d90779ebdf072c/libs/gl-plugin/src/lsp.rs#L18-L23

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.