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

Function json_to_route

plugins/libplugin.c:2647–2662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2645}
2646
2647struct route_hop *json_to_route(const tal_t *ctx, const char *buffer,
2648 const jsmntok_t *toks)
2649{
2650 size_t num = toks->size, i;
2651 struct route_hop *hops;
2652 const jsmntok_t *rtok;
2653 if (toks->type != JSMN_ARRAY)
2654 return NULL;
2655
2656 hops = tal_arr(ctx, struct route_hop, num);
2657 json_for_each_arr(i, rtok, toks) {
2658 if (!json_to_route_hop_inplace(&hops[i], buffer, rtok))
2659 return tal_free(hops);
2660 }
2661 return hops;
2662}
2663
2664struct command_result *WARN_UNUSED_RESULT
2665command_hook_success(struct command *cmd)

Callers

nothing calls this directly

Calls 2

tal_freeFunction · 0.85

Tested by

no test coverage detected