Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topology: call listpeerchannels_done directly #7704

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions plugins/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ static void gossmod_add_unknown_localchan(struct gossmap_localmods *mods,
buf, chantok, gossmap);
}

/* FIXME: We don't need this listpeerchannels at all if not deprecated! */
static struct command_result *listpeerchannels_done(struct command *cmd,
const char *buf,
const jsmntok_t *result,
Expand Down Expand Up @@ -472,9 +471,18 @@ static struct command_result *json_listchannels(struct command *cmd,
"Can only specify one of "
"`short_channel_id`, "
"`source` or `destination`");
req = jsonrpc_request_start(cmd->plugin, cmd, "listpeerchannels",

// FIXME: Once this deprecation is removed, `listpeerchannels_done` can
// be embedded in the current function.
if (command_deprecated_out_ok(cmd, "include_private", "v24.02", "v24.08")) {
req = jsonrpc_request_start(cmd->plugin, cmd, "listpeerchannels",
listpeerchannels_done, forward_error, opts);
return send_outreq(cmd->plugin, req);
return send_outreq(cmd->plugin, req);
}

// If deprecations are not necessary, call listpeerchannels_done directly,
// the output will not be used there.
return listpeerchannels_done(cmd, NULL, NULL, opts);
}

static void json_add_node(struct json_stream *js,
Expand Down
Loading