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

Function json_to_route

plugins/libplugin.c:2637–2652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2635}
2636
2637struct route_hop *json_to_route(const tal_t *ctx, const char *buffer,
2638 const jsmntok_t *toks)
2639{
2640 size_t num = toks->size, i;
2641 struct route_hop *hops;
2642 const jsmntok_t *rtok;
2643 if (toks->type != JSMN_ARRAY)
2644 return NULL;
2645
2646 hops = tal_arr(ctx, struct route_hop, num);
2647 json_for_each_arr(i, rtok, toks) {
2648 if (!json_to_route_hop_inplace(&hops[i], buffer, rtok))
2649 return tal_free(hops);
2650 }
2651 return hops;
2652}
2653
2654struct command_result *WARN_UNUSED_RESULT
2655command_hook_success(struct command *cmd)

Callers

nothing calls this directly

Calls 2

tal_freeFunction · 0.85

Tested by

no test coverage detected