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

Function json_to_route

plugins/libplugin.c:1977–1992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1975}
1976
1977struct route_hop *json_to_route(const tal_t *ctx, const char *buffer,
1978 const jsmntok_t *toks)
1979{
1980 size_t num = toks->size, i;
1981 struct route_hop *hops;
1982 const jsmntok_t *rtok;
1983 if (toks->type != JSMN_ARRAY)
1984 return NULL;
1985
1986 hops = tal_arr(ctx, struct route_hop, num);
1987 json_for_each_arr(i, rtok, toks) {
1988 if (!json_to_route_hop_inplace(&hops[i], buffer, rtok))
1989 return tal_free(hops);
1990 }
1991 return hops;
1992}
1993
1994struct command_result *WARN_UNUSED_RESULT
1995command_hook_success(struct command *cmd)

Callers

nothing calls this directly

Calls 2

tal_freeFunction · 0.85

Tested by

no test coverage detected