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

Function check_previous_invoice

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

400
401/* Now, we need to check the previous invoice was paid, and maybe get timebase */
402static struct command_result *check_previous_invoice(struct command *cmd,
403 struct invreq *ir)
404{
405 struct out_req *req;
406
407 /* No previous? Just pass through */
408 if (*ir->invreq->recurrence_counter == 0)
409 return check_period(cmd, ir, *ir->inv->created_at);
410
411 req = jsonrpc_request_start(cmd->plugin, cmd,
412 "listinvoices",
413 prev_invoice_done,
414 error,
415 ir);
416 json_add_label(req->js,
417 ir->invreq->offer_id,
418 ir->invreq->payer_key,
419 *ir->invreq->recurrence_counter - 1);
420 return send_outreq(cmd->plugin, req);
421}
422
423/* BOLT-offers #12:
424 * - MUST fail the request if `signature` is not correct.

Callers 1

Calls 3

check_periodFunction · 0.85
json_add_labelFunction · 0.85
send_outreqFunction · 0.70

Tested by

no test coverage detected