| 2570 | } |
| 2571 | |
| 2572 | struct listpeers_channel **json_to_listpeers_channels(const tal_t *ctx, |
| 2573 | const char *buffer, |
| 2574 | const jsmntok_t *tok) |
| 2575 | { |
| 2576 | size_t i; |
| 2577 | const jsmntok_t *iter; |
| 2578 | const jsmntok_t *channelstok = json_get_member(buffer, tok, "channels"); |
| 2579 | struct listpeers_channel **chans; |
| 2580 | |
| 2581 | chans = tal_arr(ctx, struct listpeers_channel *, 0); |
| 2582 | json_for_each_arr(i, iter, channelstok) { |
| 2583 | struct listpeers_channel *chan; |
| 2584 | |
| 2585 | chan = json_to_listpeers_channel(chans, buffer, iter); |
| 2586 | if (!chan) |
| 2587 | continue; |
| 2588 | tal_arr_expand(&chans, chan); |
| 2589 | } |
| 2590 | return chans; |
| 2591 | } |
| 2592 | |
| 2593 | struct createonion_response *json_to_createonion_response(const tal_t *ctx, |
| 2594 | const char *buffer, |
no test coverage detected