Output a route hop */
| 96 | |
| 97 | /* Output a route hop */ |
| 98 | static void json_add_route_hop(struct json_stream *js, |
| 99 | const char *fieldname, |
| 100 | const struct route_hop *r) |
| 101 | { |
| 102 | /* Imitate what getroute/sendpay use */ |
| 103 | json_object_start(js, fieldname); |
| 104 | json_add_node_id(js, "id", &r->node_id); |
| 105 | json_add_short_channel_id(js, "channel", &r->scid); |
| 106 | json_add_num(js, "direction", r->direction); |
| 107 | json_add_amount_msat_compat(js, r->amount, "msatoshi", "amount_msat"); |
| 108 | json_add_num(js, "delay", r->delay); |
| 109 | json_add_string(js, "style", "tlv"); |
| 110 | json_object_end(js); |
| 111 | } |
| 112 | |
| 113 | static struct command_result *json_getroute(struct command *cmd, |
| 114 | const char *buffer, |
no test coverage detected