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

Function param_reserve_path

plugins/askrene/askrene.c:226–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static struct command_result *param_reserve_path(struct command *cmd,
227 const char *name,
228 const char *buffer,
229 const jsmntok_t *tok,
230 struct reserve_hop **path)
231{
232 size_t i;
233 const jsmntok_t *t;
234
235 if (tok->type != JSMN_ARRAY)
236 return command_fail_badparam(cmd, name, buffer, tok, "should be an array");
237
238 *path = tal_arr(cmd, struct reserve_hop, tok->size);
239 json_for_each_arr(i, t, tok) {
240 struct command_result *ret;
241
242 ret = parse_reserve_hop(cmd, name, buffer, t, &(*path)[i]);
243 if (ret)
244 return ret;
245 }
246 return NULL;
247}
248
249static fp16_t *get_capacities(const tal_t *ctx,
250 struct plugin *plugin, struct gossmap *gossmap)

Callers

nothing calls this directly

Calls 2

parse_reserve_hopFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected