From 8330e3a0dff96249b76af5410d0df986f96edccc Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Mon, 30 Sep 2024 15:35:28 +0200 Subject: [PATCH] pay-plugin: set gossmods directly Multiple places in the pay lifecycle depend on mods to be set. By setting the mods directly after the first listpeerchannels call, subsequent calls to listpeerchannels are avoided. Changelog-Fixed: pay-plugin: only call listpeerchannels once during a payment lifecycle. --- plugins/libplugin-pay.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 5b927ad1a..b8f685823 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -2603,6 +2603,8 @@ local_channel_hints_listpeerchannels(struct command *cmd, const char *buffer, * otherwise start out as excluded and remain so until * forever. */ channel_hint_set_update(payment_root(p)->hints, time_now()); + p->mods = gossmods_from_listpeerchannels( + p, p->local_id, buffer, toks, true, gossmod_add_localchan, NULL); payment_continue(p); return command_still_pending(cmd);