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

Function param_recurrence_paywindow

plugins/offers_offer.c:181–207  ·  view source on GitHub ↗

-time+time */

Source from the content-addressed store, hash-verified

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