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

Function json_add_configval

lightningd/configs.c:111–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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