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

Function json_add_route_hop

plugins/topology.c:72–85  ·  view source on GitHub ↗

Output a route hop */

Source from the content-addressed store, hash-verified

70
71/* Output a route hop */
72static void json_add_route_hop(struct json_stream *js,
73 const char *fieldname,
74 const struct route_hop *r)
75{
76 /* Imitate what getroute/sendpay use */
77 json_object_start(js, fieldname);
78 json_add_node_id(js, "id", &r->node_id);
79 json_add_short_channel_id(js, "channel", r->scid);
80 json_add_num(js, "direction", r->direction);
81 json_add_amount_msat(js, "amount_msat", r->amount);
82 json_add_num(js, "delay", r->delay);
83 json_add_string(js, "style", "tlv");
84 json_object_end(js);
85}
86
87struct getroute_info {
88 struct node_id *destination;

Callers 1

try_routeFunction · 0.85

Calls 7

json_object_startFunction · 0.85
json_add_node_idFunction · 0.85
json_add_numFunction · 0.85
json_add_amount_msatFunction · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected