From 49b3459be50f1d23b91260e8eec2be509f6a7dba Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 9 Feb 2023 11:06:35 +1030 Subject: [PATCH] lightningd: don't put old deprecated `local_msat` and `remote_msat` in listpeerchannels. These were deprecated in v0.12.0, hence scheduled for removal next version anyway (use local_fund_msat and remote_funds_msat). Signed-off-by: Rusty Russell --- doc/lightning-listpeerchannels.7.md | 4 +--- doc/schemas/listpeerchannels.schema.json | 10 ---------- lightningd/peer_control.c | 5 +++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/doc/lightning-listpeerchannels.7.md b/doc/lightning-listpeerchannels.7.md index 235183c87..1d182704a 100644 --- a/doc/lightning-listpeerchannels.7.md +++ b/doc/lightning-listpeerchannels.7.md @@ -56,8 +56,6 @@ On success, an object containing **channels** is returned. It is an array of ob - **funding** (object, optional): - **local\_funds\_msat** (msat): Amount of channel we funded - **remote\_funds\_msat** (msat): Amount of channel they funded - - **local\_msat** (msat, optional): Amount of channel we funded **deprecated, removal in v23.05** - - **remote\_msat** (msat, optional): Amount of channel they funded **deprecated, removal in v23.05** - **pushed\_msat** (msat, optional): Amount pushed from opener to peer - **fee\_paid\_msat** (msat, optional): Amount we paid peer at open - **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open @@ -191,4 +189,4 @@ Main web site: Lightning RFC site (BOLT \#9): -[comment]: # ( SHA256STAMP:32eef1dd02f6bdd40e8d81057701e8170fac788f4396e34f5f505efbed360245) +[comment]: # ( SHA256STAMP:f9919b6967137945cb49392d64a42bd159123b9d3bb83833c5df3bc777065d2e) diff --git a/doc/schemas/listpeerchannels.schema.json b/doc/schemas/listpeerchannels.schema.json index d3fb4c108..496b564d8 100644 --- a/doc/schemas/listpeerchannels.schema.json +++ b/doc/schemas/listpeerchannels.schema.json @@ -189,16 +189,6 @@ "remote_funds_msat" ], "properties": { - "local_msat": { - "type": "msat", - "deprecated": "v0.12.0", - "description": "Amount of channel we funded" - }, - "remote_msat": { - "type": "msat", - "deprecated": "v0.12.0", - "description": "Amount of channel they funded" - }, "pushed_msat": { "type": "msat", "description": "Amount pushed from opener to peer" diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index dd137efe6..feaf50084 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -862,7 +862,8 @@ static void json_add_channel(struct lightningd *ld, json_object_start(response, "funding"); - if (deprecated_apis) { + /* We don't put v0.12-deprecated fields into listpeerchannels */ + if (deprecated_apis && !peer) { json_add_sat_only(response, "local_msat", channel->our_funds); json_add_sat_only(response, "remote_msat", peer_funded_sats); json_add_amount_msat_only(response, "pushed_msat", channel->push); @@ -921,7 +922,7 @@ static void json_add_channel(struct lightningd *ld, channel->our_funds); json_add_sat_only(response, "remote_funds_msat", peer_funded_sats); - if (!deprecated_apis) + if (!deprecated_apis || peer) json_add_amount_msat_only(response, "pushed_msat", channel->push); }