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

Function json_add_constraint

plugins/askrene/layer.c:1202–1217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202void json_add_constraint(struct json_stream *js,
1203 const char *fieldname,
1204 const struct constraint *c,
1205 const struct layer *layer)
1206{
1207 json_object_start(js, fieldname);
1208 if (layer)
1209 json_add_string(js, "layer", layer->name);
1210 json_add_short_channel_id_dir(js, "short_channel_id_dir", c->scidd);
1211 json_add_u64(js, "timestamp", c->timestamp);
1212 if (!amount_msat_is_zero(c->min))
1213 json_add_amount_msat(js, "minimum_msat", c->min);
1214 if (!amount_msat_eq(c->max, AMOUNT_MSAT(UINT64_MAX)))
1215 json_add_amount_msat(js, "maximum_msat", c->max);
1216 json_object_end(js);
1217}
1218
1219void json_add_bias(struct json_stream *js,
1220 const char *fieldname,

Callers 2

json_add_layerFunction · 0.85

Calls 8

json_object_startFunction · 0.85
json_add_u64Function · 0.85
amount_msat_is_zeroFunction · 0.85
json_add_amount_msatFunction · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50
amount_msat_eqFunction · 0.50

Tested by

no test coverage detected