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

Function json_add_constraint

plugins/askrene/layer.c:1231–1246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229}
1230
1231void json_add_constraint(struct json_stream *js,
1232 const char *fieldname,
1233 const struct constraint *c,
1234 const struct layer *layer)
1235{
1236 json_object_start(js, fieldname);
1237 if (layer)
1238 json_add_string(js, "layer", layer->name);
1239 json_add_short_channel_id_dir(js, "short_channel_id_dir", c->scidd);
1240 json_add_u64(js, "timestamp", c->timestamp);
1241 if (!amount_msat_is_zero(c->min))
1242 json_add_amount_msat(js, "minimum_msat", c->min);
1243 if (!amount_msat_eq(c->max, AMOUNT_MSAT(UINT64_MAX)))
1244 json_add_amount_msat(js, "maximum_msat", c->max);
1245 json_object_end(js);
1246}
1247
1248void json_add_bias(struct json_stream *js,
1249 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