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

Function NON_NULL_ARGS

lightningd/peer_control.c:966–1141  ·  view source on GitHub ↗
(1, 2, 4, 5)

Source from the content-addressed store, hash-verified

964}
965
966static void NON_NULL_ARGS(1, 2, 4, 5) json_add_channel(struct command *cmd,
967 struct json_stream *response,
968 const char *key,
969 const struct channel *channel,
970 const struct peer *peer)
971{
972 struct lightningd *ld = cmd->ld;
973 struct amount_msat funding_msat;
974 struct amount_sat peer_funded_sats;
975 const struct peer_update *peer_update;
976 u32 feerate;
977 bool has_valid_inflights;
978
979 json_object_start(response, key);
980 json_add_node_id(response, "peer_id", &peer->id);
981 json_add_bool(response, "peer_connected", peer->connected == PEER_CONNECTED);
982 if (peer->connected == PEER_CONNECTED) {
983 json_add_bool(response, "reestablished", channel->reestablished);
984 }
985 json_add_channel_type(response, "channel_type", channel->type);
986 if (channel->ignore_fee_limits) {
987 json_add_bool(response, "ignore_fee_limits", channel->ignore_fee_limits);
988 }
989 /* This reflects current gossip */
990 json_object_start(response, "updates");
991 json_object_start(response, "local");
992 json_add_amount_msat(response,
993 "htlc_minimum_msat",
994 channel->htlc_minimum_msat);
995 json_add_amount_msat(response,
996 "htlc_maximum_msat",
997 channel->htlc_maximum_msat);
998 json_add_u32(response, "cltv_expiry_delta", ld->config.cltv_expiry_delta);
999 json_add_amount_msat(response, "fee_base_msat",
1000 amount_msat(channel->feerate_base));
1001 json_add_u32(response, "fee_proportional_millionths",
1002 channel->feerate_ppm);
1003 json_object_end(response);
1004
1005 peer_update = channel_gossip_get_remote_update(channel);
1006 if (peer_update) {
1007 json_object_start(response, "remote");
1008 json_add_amount_msat(response,
1009 "htlc_minimum_msat",
1010 peer_update->htlc_minimum_msat);
1011 json_add_amount_msat(response,
1012 "htlc_maximum_msat",
1013 peer_update->htlc_maximum_msat);
1014 json_add_u32(response, "cltv_expiry_delta", peer_update->cltv_delta);
1015 json_add_amount_msat(response, "fee_base_msat",
1016 amount_msat(peer_update->fee_base));
1017 json_add_u32(response, "fee_proportional_millionths",
1018 peer_update->fee_ppm);
1019 json_object_end(response);
1020 }
1021 json_object_end(response);
1022
1023 if (channel->last_stable_connection != 0) {

Callers 9

wallet.hFile · 0.85
str.hFile · 0.85
gossmap.hFile · 0.85
configvar.hFile · 0.85
coin_mvt.hFile · 0.85
blindedpath.hFile · 0.85
wire_error.hFile · 0.85
onion_encode.hFile · 0.85
libplugin.hFile · 0.85

Calls 15

json_object_startFunction · 0.85
json_add_amount_msatFunction · 0.85
json_add_u32Function · 0.85
json_object_endFunction · 0.85
json_add_u64Function · 0.85
json_add_txidFunction · 0.85
json_add_amount_sat_msatFunction · 0.85
bitcoin_tx_compute_feeFunction · 0.85
json_add_boolFunction · 0.85
feerate_style_nameFunction · 0.85
feerate_to_styleFunction · 0.85

Tested by

no test coverage detected