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

Function set_recurring_inv_expiry

plugins/offers_invreq_hook.c:123–134  ·  view source on GitHub ↗

BOLT-offers-recurrence #12: * - if the invoice corresponds to an offer with `recurrence`: * ... * - if it sets `relative_expiry`: * - MUST NOT set `relative_expiry` `seconds_from_creation` more than the * number of seconds after `created_at` that payment for this period will * be accepted. */

Source from the content-addressed store, hash-verified

121 * be accepted.
122 */
123static void set_recurring_inv_expiry(struct tlv_invoice *inv, u64 last_pay)
124{
125 inv->relative_expiry = tal(inv, u32);
126
127 /* Don't give them a 0 second invoice, even if it's true. */
128 if (last_pay <= *inv->created_at)
129 *inv->relative_expiry = 1;
130 else
131 *inv->relative_expiry = last_pay - *inv->created_at;
132
133 /* FIXME: Shorten expiry if we're doing currency conversion! */
134}
135
136/* We rely on label forms for uniqueness. */
137static void json_add_label(struct json_stream *js,

Callers 1

check_periodFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected