From 67f23c19f763c2820714409a67b17eb8d6c6336b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 14 Mar 2023 15:48:50 +1030 Subject: [PATCH] lightningd: remove deprecated local_msat, remote_msat from listpeers. Changelog-Removed: JSON-RPC: `listpeers`.`local_msat` and `listpeers`.`remote_msat` (deprecated v0.12.0) Signed-off-by: Rusty Russell --- cln-grpc/proto/node.proto | 2 -- cln-grpc/src/convert.rs | 6 ------ cln-rpc/src/model.rs | 6 ------ contrib/pyln-testing/pyln/testing/grpc2py.py | 2 -- doc/lightning-listpeers.7.md | 4 +--- doc/schemas/listpeers.schema.json | 10 ---------- lightningd/peer_control.c | 12 ++---------- 7 files changed, 3 insertions(+), 39 deletions(-) diff --git a/cln-grpc/proto/node.proto b/cln-grpc/proto/node.proto index f9fb13ba0..aacb7eb42 100644 --- a/cln-grpc/proto/node.proto +++ b/cln-grpc/proto/node.proto @@ -241,8 +241,6 @@ message ListpeersPeersChannelsInflight { } message ListpeersPeersChannelsFunding { - optional Amount local_msat = 1; - optional Amount remote_msat = 2; optional Amount pushed_msat = 3; Amount local_funds_msat = 4; Amount remote_funds_msat = 7; diff --git a/cln-grpc/src/convert.rs b/cln-grpc/src/convert.rs index 7f3b46845..81c51c04f 100644 --- a/cln-grpc/src/convert.rs +++ b/cln-grpc/src/convert.rs @@ -117,10 +117,6 @@ impl From for pb::ListpeersPeersChann impl From for pb::ListpeersPeersChannelsFunding { fn from(c: responses::ListpeersPeersChannelsFunding) -> Self { Self { - #[allow(deprecated)] - local_msat: c.local_msat.map(|f| f.into()), // Rule #2 for type msat? - #[allow(deprecated)] - remote_msat: c.remote_msat.map(|f| f.into()), // Rule #2 for type msat? pushed_msat: c.pushed_msat.map(|f| f.into()), // Rule #2 for type msat? local_funds_msat: Some(c.local_funds_msat.into()), // Rule #2 for type msat remote_funds_msat: Some(c.remote_funds_msat.into()), // Rule #2 for type msat @@ -2460,8 +2456,6 @@ impl From for responses::ListpeersPeersChann impl From for responses::ListpeersPeersChannelsFunding { fn from(c: pb::ListpeersPeersChannelsFunding) -> Self { Self { - local_msat: c.local_msat.map(|a| a.into()), // Rule #1 for type msat? - remote_msat: c.remote_msat.map(|a| a.into()), // Rule #1 for type msat? pushed_msat: c.pushed_msat.map(|a| a.into()), // Rule #1 for type msat? local_funds_msat: c.local_funds_msat.unwrap().into(), // Rule #1 for type msat remote_funds_msat: c.remote_funds_msat.unwrap().into(), // Rule #1 for type msat diff --git a/cln-rpc/src/model.rs b/cln-rpc/src/model.rs index 730038736..7326d182a 100644 --- a/cln-rpc/src/model.rs +++ b/cln-rpc/src/model.rs @@ -1561,12 +1561,6 @@ pub mod responses { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ListpeersPeersChannelsFunding { - #[deprecated] - #[serde(skip_serializing_if = "Option::is_none")] - pub local_msat: Option, - #[deprecated] - #[serde(skip_serializing_if = "Option::is_none")] - pub remote_msat: Option, #[serde(skip_serializing_if = "Option::is_none")] pub pushed_msat: Option, pub local_funds_msat: Amount, diff --git a/contrib/pyln-testing/pyln/testing/grpc2py.py b/contrib/pyln-testing/pyln/testing/grpc2py.py index 241d32894..4a33b0f91 100644 --- a/contrib/pyln-testing/pyln/testing/grpc2py.py +++ b/contrib/pyln-testing/pyln/testing/grpc2py.py @@ -100,8 +100,6 @@ def listpeers_peers_channels_inflight2py(m): def listpeers_peers_channels_funding2py(m): return remove_default({ - "local_msat": amount2msat(m.local_msat), # PrimitiveField in generate_composite - "remote_msat": amount2msat(m.remote_msat), # PrimitiveField in generate_composite "pushed_msat": amount2msat(m.pushed_msat), # PrimitiveField in generate_composite "local_funds_msat": amount2msat(m.local_funds_msat), # PrimitiveField in generate_composite "remote_funds_msat": amount2msat(m.remote_funds_msat), # PrimitiveField in generate_composite diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index 58ae047ce..7acd42b47 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -96,8 +96,6 @@ On success, an object containing **peers** is returned. It is an array of objec - **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 @@ -400,4 +398,4 @@ Main web site: Lightning RFC site (BOLT \#9): -[comment]: # ( SHA256STAMP:227b5af94d1f299a4e88e450c074960ca8d109b634e24693ad389ef02f64f525) +[comment]: # ( SHA256STAMP:156e5622823a8b948c0f15f694afc1d87bb5107091e5b65ee6190b4067661bb4) diff --git a/doc/schemas/listpeers.schema.json b/doc/schemas/listpeers.schema.json index 1374eed62..03de437a5 100644 --- a/doc/schemas/listpeers.schema.json +++ b/doc/schemas/listpeers.schema.json @@ -347,16 +347,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 feaf50084..0096fc218 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -862,13 +862,6 @@ static void json_add_channel(struct lightningd *ld, json_object_start(response, "funding"); - /* 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); - } - if (channel->lease_commit_sig) { struct amount_sat funds, total; if (!amount_msat_to_sat(&funds, channel->push)) { @@ -922,9 +915,8 @@ 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 || peer) - json_add_amount_msat_only(response, "pushed_msat", - channel->push); + json_add_amount_msat_only(response, "pushed_msat", + channel->push); } json_object_end(response);