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

Function NON_NULL_ARGS

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

Source from the content-addressed store, hash-verified

933}
934
935static void NON_NULL_ARGS(1, 2, 4, 5) json_add_channel(struct command *cmd,
936 struct json_stream *response,
937 const char *key,
938 const struct channel *channel,
939 const struct peer *peer)
940{
941 struct lightningd *ld = cmd->ld;
942 struct amount_msat funding_msat;
943 struct amount_sat peer_funded_sats;
944 const struct peer_update *peer_update;
945 u32 feerate;
946 bool has_valid_inflights;
947
948 json_object_start(response, key);
949 json_add_node_id(response, "peer_id", &peer->id);
950 json_add_bool(response, "peer_connected", peer->connected == PEER_CONNECTED);
951 if (peer->connected == PEER_CONNECTED) {
952 json_add_bool(response, "reestablished", channel->reestablished);
953 }
954 json_add_channel_type(response, "channel_type", channel->type);
955 if (channel->ignore_fee_limits) {
956 json_add_bool(response, "ignore_fee_limits", channel->ignore_fee_limits);
957 }
958 /* This reflects current gossip */
959 json_object_start(response, "updates");
960 json_object_start(response, "local");
961 json_add_amount_msat(response,
962 "htlc_minimum_msat",
963 channel->htlc_minimum_msat);
964 json_add_amount_msat(response,
965 "htlc_maximum_msat",
966 channel->htlc_maximum_msat);
967 json_add_u32(response, "cltv_expiry_delta", ld->config.cltv_expiry_delta);
968 json_add_amount_msat(response, "fee_base_msat",
969 amount_msat(channel->feerate_base));
970 json_add_u32(response, "fee_proportional_millionths",
971 channel->feerate_ppm);
972 json_object_end(response);
973
974 peer_update = channel_gossip_get_remote_update(channel);
975 if (peer_update) {
976 json_object_start(response, "remote");
977 json_add_amount_msat(response,
978 "htlc_minimum_msat",
979 peer_update->htlc_minimum_msat);
980 json_add_amount_msat(response,
981 "htlc_maximum_msat",
982 peer_update->htlc_maximum_msat);
983 json_add_u32(response, "cltv_expiry_delta", peer_update->cltv_delta);
984 json_add_amount_msat(response, "fee_base_msat",
985 amount_msat(peer_update->fee_base));
986 json_add_u32(response, "fee_proportional_millionths",
987 peer_update->fee_ppm);
988 json_object_end(response);
989 }
990 json_object_end(response);
991
992 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