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

Function param_algorithm

plugins/askrene/askrene.c:381–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379};
380
381static struct command_result *
382param_algorithm(struct command *cmd, const char *name, const char *buffer,
383 const jsmntok_t *tok, enum algorithm **algo)
384{
385 const char *algo_str = json_strdup(cmd, buffer, tok);
386 *algo = tal(cmd, enum algorithm);
387 if (streq(algo_str, "default"))
388 **algo = ALGO_DEFAULT;
389 else if (streq(algo_str, "single-path"))
390 **algo = ALGO_SINGLE_PATH;
391 else
392 return command_fail_badparam(cmd, name, buffer, tok,
393 "unknown algorithm");
394 return NULL;
395}
396
397struct getroutes_info {
398 /* We keep this around in askrene->waiting if we're busy */

Callers

nothing calls this directly

Calls 2

json_strdupFunction · 0.50
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected