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

Function param_recurrence

plugins/offers_offer.c:140–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static struct command_result *param_recurrence(struct command *cmd,
141 const char *name,
142 const char *buffer,
143 const jsmntok_t *tok,
144 struct recurrence **recurrence)
145{
146 u32 mul, period;
147 const struct time_string *ts;
148
149 ts = json_to_time(buffer, tok, &mul);
150 if (!ts)
151 return command_fail_badparam(cmd, name, buffer, tok,
152 "not a valid time");
153
154 if (!assign_overflow_u32(&period, ts->mul * (u64)mul))
155 return command_fail_badparam(
156 cmd, name, buffer, tok,
157 "period is too large to fit in 32 bits");
158
159 *recurrence = tal(cmd, struct recurrence);
160 (*recurrence)->time_unit = ts->unit;
161 (*recurrence)->period = period;
162 return NULL;
163}
164
165static struct command_result *param_recurrence_base(struct command *cmd,
166 const char *name,

Callers

nothing calls this directly

Calls 3

json_to_timeFunction · 0.85
assign_overflow_u32Function · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected