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. */
| 121 | * be accepted. |
| 122 | */ |
| 123 | static 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. */ |
| 137 | static void json_add_label(struct json_stream *js, |