(1, 2, 4, 5)
| 933 | } |
| 934 | |
| 935 | static 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) { |
no test coverage detected