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.
This commit is contained in:
Jesse de Wit
2024-09-30 15:35:28 +02:00
committed by Christian Decker
parent 281c639b57
commit 8330e3a0df

View File

@@ -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);