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

Function param_recurrence_paywindow

plugins/offers_offer.c:176–202  ·  view source on GitHub ↗

-time+time */

Source from the content-addressed store, hash-verified

174
175/* -time+time */
176static struct command_result *param_recurrence_paywindow(struct command *cmd,
177 const char *name,
178 const char *buffer,
179 const jsmntok_t *tok,
180 struct recurrence_paywindow
181 **paywindow)
182{
183 jsmntok_t t, before, after;
184
185 *paywindow = tal(cmd, struct recurrence_paywindow);
186 t = *tok;
187 if (!json_tok_startswith(buffer, &t, "-"))
188 return command_fail_badparam(cmd, name, buffer, tok,
189 "expected -time+time");
190 t.start++;
191 if (!split_tok(buffer, &t, '+', &before, &after))
192 return command_fail_badparam(cmd, name, buffer, tok,
193 "expected -time+time");
194
195 if (!json_to_u32(buffer, &before, &(*paywindow)->seconds_before))
196 return command_fail_badparam(cmd, name, buffer, &before,
197 "expected number of seconds");
198 if (!json_to_u32(buffer, &after, &(*paywindow)->seconds_after))
199 return command_fail_badparam(cmd, name, buffer, &after,
200 "expected number of seconds");
201 return NULL;
202}
203
204struct offer_info {
205 struct tlv_offer *offer;

Callers

nothing calls this directly

Calls 4

json_tok_startswithFunction · 0.85
split_tokFunction · 0.85
command_fail_badparamFunction · 0.50
json_to_u32Function · 0.50

Tested by

no test coverage detected