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

Function json_add_route_hop

plugins/topology.c:98–111  ·  view source on GitHub ↗

Output a route hop */

Source from the content-addressed store, hash-verified

96
97/* Output a route hop */
98static 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
113static struct command_result *json_getroute(struct command *cmd,
114 const char *buffer,

Callers 1

json_getrouteFunction · 0.85

Calls 7

json_object_startFunction · 0.50
json_add_node_idFunction · 0.50
json_add_numFunction · 0.50
json_add_stringFunction · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected