From 1de124277be65590c9dd54bedfd0412c3f88650d Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Mon, 12 Mar 2018 13:25:11 +0000 Subject: [PATCH] peer_control: Print both `to_self_delay` in listpeers. --- lightningd/peer_control.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index cefc44994..f640576c1 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -665,8 +665,17 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg, channel->our_config.channel_reserve_satoshis); json_add_u64(response, "htlc_minimum_msat", channel->our_config.htlc_minimum_msat); - json_add_num(response, "to_self_delay", + /* The `to_self_delay` is imposed on the *other* + * side, so our configuration `to_self_delay` is + * imposed on their side, while their configuration + * `to_self_delay` is imposed on ours. */ + json_add_num(response, "their_to_self_delay", channel->our_config.to_self_delay); + json_add_num(response, "our_to_self_delay", + channel->channel_info.their_config.to_self_delay); + if (deprecated_apis) + json_add_num(response, "to_self_delay", + channel->our_config.to_self_delay); json_add_num(response, "max_accepted_htlcs", channel->our_config.max_accepted_htlcs);