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

Function check_params

common/json_param.c:236–256  ·  view source on GitHub ↗

* Verify consistent internal state. */

Source from the content-addressed store, hash-verified

234 * Verify consistent internal state.
235 */
236static bool check_params(struct param *params)
237{
238 if (tal_count(params) < 2)
239 return true;
240
241 /* make sure there are no required params following optional */
242 if (!check_distinct(params, comp_req_order))
243 return false;
244
245 /* duplicate so we can sort */
246 struct param *copy = tal_dup_talarr(params, struct param, params);
247
248 /* check for repeated names and args */
249 if (!check_unique(copy, comp_by_name))
250 return false;
251 if (!check_unique(copy, comp_by_arg))
252 return false;
253
254 tal_free(copy);
255 return true;
256}
257#endif
258
259static char *param_usage(const tal_t *ctx,

Callers 1

param_arrFunction · 0.85

Calls 3

check_distinctFunction · 0.85
check_uniqueFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected