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

Function json_add_local_update

plugins/askrene/layer.c:1205–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1203}
1204
1205static void json_add_local_update(struct json_stream *response,
1206 const char *fieldname,
1207 const struct local_update *lu)
1208{
1209 json_object_start(response, fieldname);
1210 json_add_short_channel_id_dir(response, "short_channel_id_dir",
1211 lu->scidd);
1212 if (lu->enabled)
1213 json_add_bool(response, "enabled", *lu->enabled);
1214 if (lu->htlc_min)
1215 json_add_amount_msat(response,
1216 "htlc_minimum_msat", *lu->htlc_min);
1217 if (lu->htlc_max)
1218 json_add_amount_msat(response,
1219 "htlc_maximum_msat", *lu->htlc_max);
1220 if (lu->base_fee)
1221 json_add_amount_msat(response, "fee_base_msat", *lu->base_fee);
1222 if (lu->proportional_fee)
1223 json_add_u32(response,
1224 "fee_proportional_millionths",
1225 *lu->proportional_fee);
1226 if (lu->delay)
1227 json_add_u32(response, "cltv_expiry_delta", *lu->delay);
1228 json_object_end(response);
1229}
1230
1231void json_add_constraint(struct json_stream *js,
1232 const char *fieldname,

Callers 1

json_add_layerFunction · 0.85

Calls 6

json_object_startFunction · 0.85
json_add_boolFunction · 0.85
json_add_amount_msatFunction · 0.85
json_add_u32Function · 0.85
json_object_endFunction · 0.85

Tested by

no test coverage detected