core-lightning/connectd/onion_message.h
Rusty Russell b5f921ce0a lightningd: add routine to directly inject an onion message.
Unlike "sendonionmessage" which instructs us to send to a peer, this
process it locally (presumably, it contains the next hop).  This is
useful because it allows us to process an onion message which starts
with us (a legal case for a blinded path supplied by someone else!).
It also opens the door to bolt12 self-pay.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-07-10 13:34:00 +02:00

17 lines
563 B
C

#ifndef LIGHTNING_CONNECTD_ONION_MESSAGE_H
#define LIGHTNING_CONNECTD_ONION_MESSAGE_H
#include "config.h"
#include <ccan/short_types/short_types.h>
/* Onion message comes in from peer. */
void handle_onion_message(struct daemon *daemon,
struct peer *peer, const u8 *msg);
/* Lightningd tells us to send an onion message */
void onionmsg_req(struct daemon *daemon, const u8 *msg);
/* Lightning tells us unwrap onion message as if from peer */
void inject_onionmsg_req(struct daemon *daemon, const u8 *msg);
#endif /* LIGHTNING_CONNECTD_ONION_MESSAGE_H */