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

Function offer_period_start

common/bolt12.c:475–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475u64 offer_period_start(u64 basetime, size_t n,
476 const struct recurrence *recur)
477{
478 /* BOLT-recurrence #12:
479 * 1. A `time_unit` defining 0 (seconds), 1 (days), 2 (months).
480 */
481 switch (recur->time_unit) {
482 case 0:
483 return basetime + recur->period * n;
484 case 1:
485 return time_change(basetime, recur->period * n, add_days, false);
486 case 2:
487 return time_change(basetime, recur->period * n, add_months, true);
488 default:
489 /* This is our offer, how did we get here? */
490 return 0;
491 }
492}
493
494void offer_period_paywindow(const struct recurrence *recurrence,
495 const struct recurrence_paywindow *recurrence_paywindow,

Callers 4

offer_period_paywindowFunction · 0.85
mainFunction · 0.85
check_periodFunction · 0.85
handle_invreq_responseFunction · 0.85

Calls 1

time_changeFunction · 0.85

Tested by 1

mainFunction · 0.68