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

Function create_invoicereq

plugins/offers_invreq_hook.c:236–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236static struct command_result *create_invoicereq(struct command *cmd,
237 struct invreq *ir)
238{
239 struct out_req *req;
240
241 /* FIXME: We should add a real blinded path, and we *need to*
242 * if we don't have public channels! */
243
244 /* Now, write invoice to db (returns the signed version) */
245 req = jsonrpc_request_start(cmd, "createinvoice",
246 createinvoice_done, createinvoice_error, ir);
247
248 json_add_string(req->js, "invstring", invoice_encode(tmpctx, ir->inv));
249 json_add_preimage(req->js, "preimage", &ir->preimage);
250 json_add_label(req->js, &ir->offer_id, ir->inv->invreq_payer_id,
251 ir->inv->invreq_recurrence_counter
252 ? *ir->inv->invreq_recurrence_counter : 0);
253 return send_outreq(req);
254}
255
256/* FIXME: Allow multihop! */
257/* FIXME: And add padding! */

Callers 3

found_best_peerFunction · 0.85
add_blindedpathsFunction · 0.85
cancel_invoiceFunction · 0.85

Calls 5

invoice_encodeFunction · 0.85
json_add_preimageFunction · 0.85
json_add_labelFunction · 0.85
send_outreqFunction · 0.70
json_add_stringFunction · 0.50

Tested by

no test coverage detected