plugins/offer: handle receiving an invoice in an onion_message.

And if we have a matching `send_invoice` offer, try to pay it!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-01-08 05:06:47 +10:30
parent 6d1fe7e599
commit f2d2db7b4e
4 changed files with 432 additions and 2 deletions

11
plugins/offers_inv_hook.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef LIGHTNING_PLUGINS_OFFERS_INV_HOOK_H
#define LIGHTNING_PLUGINS_OFFERS_INV_HOOK_H
#include "config.h"
#include <plugins/libplugin.h>
/* We got an onionmessage with an invoice! replytok could be NULL. */
struct command_result *handle_invoice(struct command *cmd,
const char *buf,
const jsmntok_t *invtok,
const jsmntok_t *replytok);
#endif /* LIGHTNING_PLUGINS_OFFERS_INV_HOOK_H */