Skip to content

Commit

Permalink
pay: Subscribe to the channel_hint_update notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Aug 9, 2024
1 parent e46fb11 commit ac10d98
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions plugins/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,13 @@ static struct command_result *json_pay(struct command *cmd,
return send_outreq(cmd->plugin, req);
}

static struct command_result *handle_channel_hint_update(struct command *cmd,
const char *buf,
const jsmntok_t *param)
{
return command_done();
}

static const struct plugin_command commands[] = {
{
"paystatus",
Expand All @@ -1532,15 +1539,23 @@ static const char *notification_topics[] = {
"channel_hint_update",
};

static const struct plugin_notification notification_subs[] = {
{
"channel_hint_update",
handle_channel_hint_update,
},
};

int main(int argc, char *argv[])
{
setup_locale();
plugin_main(argv, init, NULL, PLUGIN_RESTARTABLE, true, NULL, commands,
ARRAY_SIZE(commands), NULL, 0, NULL, 0,
notification_topics, ARRAY_SIZE(notification_topics),
ARRAY_SIZE(commands), notification_subs,
ARRAY_SIZE(notification_subs), NULL, 0, notification_topics,
ARRAY_SIZE(notification_topics),
plugin_option("disable-mpp", "flag",
"Disable multi-part payments.",
flag_option, flag_jsonfmt, &disablempp),
"Disable multi-part payments.", flag_option,
flag_jsonfmt, &disablempp),
NULL);
io_poll_override(libplugin_pay_poll);
}

0 comments on commit ac10d98

Please sign in to comment.