MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_askrene_reserve

Function json_askrene_reserve

plugins/askrene/askrene.c:971–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971static struct command_result *json_askrene_reserve(struct command *cmd,
972 const char *buffer,
973 const jsmntok_t *params)
974{
975 struct reserve_hop *path;
976 struct json_stream *response;
977 struct askrene *askrene = get_askrene(cmd->plugin);
978
979 if (!param(cmd, buffer, params,
980 p_req("path", param_reserve_path, &path),
981 NULL))
982 return command_param_failed();
983 plugin_log(cmd->plugin, LOG_TRACE, "%s called: %.*s", __func__,
984 json_tok_full_len(params), json_tok_full(buffer, params));
985
986 for (size_t i = 0; i < tal_count(path); i++)
987 reserve_add(askrene->reserved, &path[i], cmd->id);
988
989 response = jsonrpc_stream_success(cmd);
990 return command_finished(cmd, response);
991}
992
993static struct command_result *json_askrene_unreserve(struct command *cmd,
994 const char *buffer,

Callers

nothing calls this directly

Calls 9

get_askreneFunction · 0.85
reserve_addFunction · 0.85
paramFunction · 0.50
command_param_failedFunction · 0.50
plugin_logFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50
jsonrpc_stream_successFunction · 0.50
command_finishedFunction · 0.50

Tested by

no test coverage detected