(1, 2, 4, 5)
| 989 | } |
| 990 | |
| 991 | static void NON_NULL_ARGS(1, 2, 4, 5) json_add_channel(struct command *cmd, |
| 992 | struct json_stream *response, |
| 993 | const char *key, |
| 994 | const struct channel *channel, |
| 995 | const struct peer *peer) |
| 996 | { |
| 997 | struct lightningd *ld = cmd->ld; |
| 998 | struct amount_msat funding_msat; |
| 999 | struct amount_sat peer_funded_sats; |
| 1000 | const struct peer_update *peer_update; |
| 1001 | u32 feerate; |
| 1002 | bool has_valid_inflights; |
| 1003 | |
| 1004 | json_object_start(response, key); |
| 1005 | json_add_node_id(response, "peer_id", &peer->id); |
| 1006 | json_add_bool(response, "peer_connected", peer->connected == PEER_CONNECTED); |
| 1007 | if (peer->connected == PEER_CONNECTED) { |
| 1008 | json_add_bool(response, "reestablished", channel->reestablished); |
| 1009 | } |
| 1010 | json_add_channel_type(response, "channel_type", channel->type); |
| 1011 | if (channel->ignore_fee_limits) { |
| 1012 | json_add_bool(response, "ignore_fee_limits", channel->ignore_fee_limits); |
| 1013 | } |
| 1014 | /* This reflects current gossip */ |
| 1015 | json_object_start(response, "updates"); |
| 1016 | json_object_start(response, "local"); |
| 1017 | json_add_amount_msat(response, |
| 1018 | "htlc_minimum_msat", |
| 1019 | channel->htlc_minimum_msat); |
| 1020 | json_add_amount_msat(response, |
| 1021 | "htlc_maximum_msat", |
| 1022 | channel->htlc_maximum_msat); |
| 1023 | json_add_u32(response, "cltv_expiry_delta", ld->config.cltv_expiry_delta); |
| 1024 | json_add_amount_msat(response, "fee_base_msat", |
| 1025 | amount_msat(channel->feerate_base)); |
| 1026 | json_add_u32(response, "fee_proportional_millionths", |
| 1027 | channel->feerate_ppm); |
| 1028 | json_object_end(response); |
| 1029 | |
| 1030 | peer_update = channel_gossip_get_remote_update(channel); |
| 1031 | if (peer_update) { |
| 1032 | json_object_start(response, "remote"); |
| 1033 | json_add_amount_msat(response, |
| 1034 | "htlc_minimum_msat", |
| 1035 | peer_update->htlc_minimum_msat); |
| 1036 | json_add_amount_msat(response, |
| 1037 | "htlc_maximum_msat", |
| 1038 | peer_update->htlc_maximum_msat); |
| 1039 | json_add_u32(response, "cltv_expiry_delta", peer_update->cltv_delta); |
| 1040 | json_add_amount_msat(response, "fee_base_msat", |
| 1041 | amount_msat(peer_update->fee_base)); |
| 1042 | json_add_u32(response, "fee_proportional_millionths", |
| 1043 | peer_update->fee_ppm); |
| 1044 | json_object_end(response); |
| 1045 | } |
| 1046 | json_object_end(response); |
| 1047 | |
| 1048 | if (channel->last_stable_connection != 0) { |
no test coverage detected