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

Function unreserve_path

plugins/xpay/xpay.c:1198–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196}
1197
1198static struct command_result *unreserve_path(struct command *aux_cmd,
1199 struct attempt *attempt)
1200{
1201 struct out_req *req;
1202
1203 req = payment_ignored_req(aux_cmd, attempt, "askrene-unreserve");
1204 json_array_start(req->js, "path");
1205 for (size_t i = 0; i < tal_count(attempt->hops); i++) {
1206 const struct hop *hop = &attempt->hops[i];
1207 json_object_start(req->js, NULL);
1208 json_add_short_channel_id_dir(req->js, "short_channel_id_dir", hop->scidd);
1209 json_add_amount_msat(req->js, "amount_msat", hop->amount_out);
1210 if (hop->fake_channel)
1211 json_add_string(req->js, "layer", attempt->payment->private_layer);
1212 json_object_end(req->js);
1213 }
1214 json_array_end(req->js);
1215 return send_payment_req(aux_cmd, attempt->payment, req);
1216}
1217
1218static struct command_result *injectpaymentonion_failed(struct command *aux_cmd,
1219 const char *method,

Callers 2

Calls 9

payment_ignored_reqFunction · 0.85
json_array_startFunction · 0.85
json_object_startFunction · 0.85
json_add_amount_msatFunction · 0.85
json_object_endFunction · 0.85
json_array_endFunction · 0.85
send_payment_reqFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected