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

Function check_previous_invoice

plugins/offers_invreq_hook.c:624–643  ·  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

622
623/* Now, we need to check the previous invoice was paid, and maybe get timebase */
624static struct command_result *check_previous_invoice(struct command *cmd,
625 struct invreq *ir)
626{
627 struct out_req *req;
628
629 /* No previous? Just pass through */
630 if (*ir->invreq->invreq_recurrence_counter == 0)
631 return check_period(cmd, ir, *ir->inv->invoice_created_at);
632
633 req = jsonrpc_request_start(cmd,
634 "listinvoices",
635 prev_invoice_done,
636 error,
637 ir);
638 json_add_label(req->js,
639 &ir->offer_id,
640 ir->invreq->invreq_payer_id,
641 *ir->invreq->invreq_recurrence_counter - 1);
642 return send_outreq(req);
643}
644
645/* BOLT #12:
646

Callers 1

Calls 3

check_periodFunction · 0.85
json_add_labelFunction · 0.85
send_outreqFunction · 0.70

Tested by

no test coverage detected