Skip to content

Introduce ResponseInstructions for OnionMessage Handling#2907

Merged
jkczyz merged 2 commits intolightningdevkit:mainfrom
shaavan:issue2882
May 8, 2024
Merged

Introduce ResponseInstructions for OnionMessage Handling#2907
jkczyz merged 2 commits intolightningdevkit:mainfrom
shaavan:issue2882

Conversation

@shaavan
Copy link
Copy Markdown
Member

@shaavan shaavan commented Feb 21, 2024

resolves #2882

Introduce ResponseInstructions for OnionMessage Handling

  • Currently, handle_message (or handle_custom_message) only exposes the generated response for an OnionMessage, lacking the necessary reply_path for asynchronous responses.
  • This PR introduces a new flow for OnionMessage handling.
  • Instead of solely taking the message as input, handle_message now accepts an Optional responder, returning a ResponseInstruction containing both the response and the reply_path.
  • ResponseInstruction utilizes different enum variants to indicate how handle_onion_message_response should handle the response.
  • This enhancement enables exposing the reply_path alongside the response and allows for more complex response mechanisms, such as responding with an added reply_path.

Loading
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.

CustomOnionMessageHandler::handle_message doesn't expose the reply_path

4 participants