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

Function check_previous_invoice

plugins/offers_invreq_hook.c:598–617  ·  view source on GitHub ↗

Now, we need to check the previous invoice was paid, and maybe get timebase */

Source from the content-addressed store, hash-verified

596
597/* Now, we need to check the previous invoice was paid, and maybe get timebase */
598static struct command_result *check_previous_invoice(struct command *cmd,
599 struct invreq *ir)
600{
601 struct out_req *req;
602
603 /* No previous? Just pass through */
604 if (*ir->invreq->invreq_recurrence_counter == 0)
605 return check_period(cmd, ir, *ir->inv->invoice_created_at);
606
607 req = jsonrpc_request_start(cmd,
608 "listinvoices",
609 prev_invoice_done,
610 error,
611 ir);
612 json_add_label(req->js,
613 &ir->offer_id,
614 ir->invreq->invreq_payer_id,
615 *ir->invreq->invreq_recurrence_counter - 1);
616 return send_outreq(req);
617}
618
619/* BOLT #12:
620

Callers 1

Calls 3

check_periodFunction · 0.85
json_add_labelFunction · 0.85
send_outreqFunction · 0.70

Tested by

no test coverage detected