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

Function json_add_configval

lightningd/configs.c:110–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110static void json_add_configval(struct json_stream *result,
111 const char *fieldname,
112 const struct opt_table *ot,
113 const char *str)
114{
115 if (ot->type & OPT_SHOWBOOL) {
116 json_add_bool(result, fieldname, opt_canon_bool(str));
117 } else if (ot->type & (OPT_SHOWMSATS|OPT_SHOWINT)) {
118 check_literal(ot->names, str);
119 json_add_primitive(result, fieldname, str);
120 } else
121 json_add_string(result, fieldname, str);
122}
123
124/* Config vars can have multiple names ("--large-channels|--wumbo"), but first
125 * is preferred.

Callers 1

json_add_configFunction · 0.85

Calls 5

json_add_boolFunction · 0.85
opt_canon_boolFunction · 0.85
check_literalFunction · 0.85
json_add_primitiveFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected