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

Function param_recurrence_base

plugins/offers_offer.c:171–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171static struct command_result *param_recurrence_base(struct command *cmd,
172 const char *name,
173 const char *buffer,
174 const jsmntok_t *tok,
175 struct tlv_offer_recurrence_base **base)
176{
177 /* Make copy so we can manipulate it */
178 jsmntok_t t = *tok;
179
180 *base = tal(cmd, struct tlv_offer_recurrence_base);
181 if (json_tok_startswith(buffer, &t, "@")) {
182 t.start++;
183 (*base)->start_any_period = false;
184 } else
185 (*base)->start_any_period = true;
186
187 if (!json_to_u64(buffer, &t, &(*base)->basetime))
188 return command_fail_badparam(cmd, name, buffer, tok,
189 "not a valid basetime or @basetime");
190 return NULL;
191}
192
193/* -time+time[%] */
194static struct command_result *param_recurrence_paywindow(struct command *cmd,

Callers

nothing calls this directly

Calls 3

command_fail_badparamFunction · 0.85
json_tok_startswithFunction · 0.50
json_to_u64Function · 0.50

Tested by

no test coverage detected