mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
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 <rusty@rustcorp.com.au>
This commit is contained in:
parent
06b9009dd8
commit
67f23c19f7
7 changed files with 3 additions and 39 deletions
2
cln-grpc/proto/node.proto
generated
2
cln-grpc/proto/node.proto
generated
|
@ -241,8 +241,6 @@ message ListpeersPeersChannelsInflight {
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListpeersPeersChannelsFunding {
|
message ListpeersPeersChannelsFunding {
|
||||||
optional Amount local_msat = 1;
|
|
||||||
optional Amount remote_msat = 2;
|
|
||||||
optional Amount pushed_msat = 3;
|
optional Amount pushed_msat = 3;
|
||||||
Amount local_funds_msat = 4;
|
Amount local_funds_msat = 4;
|
||||||
Amount remote_funds_msat = 7;
|
Amount remote_funds_msat = 7;
|
||||||
|
|
6
cln-grpc/src/convert.rs
generated
6
cln-grpc/src/convert.rs
generated
|
@ -117,10 +117,6 @@ impl From<responses::ListpeersPeersChannelsInflight> for pb::ListpeersPeersChann
|
||||||
impl From<responses::ListpeersPeersChannelsFunding> for pb::ListpeersPeersChannelsFunding {
|
impl From<responses::ListpeersPeersChannelsFunding> for pb::ListpeersPeersChannelsFunding {
|
||||||
fn from(c: responses::ListpeersPeersChannelsFunding) -> Self {
|
fn from(c: responses::ListpeersPeersChannelsFunding) -> Self {
|
||||||
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?
|
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
|
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
|
remote_funds_msat: Some(c.remote_funds_msat.into()), // Rule #2 for type msat
|
||||||
|
@ -2460,8 +2456,6 @@ impl From<pb::ListpeersPeersChannelsInflight> for responses::ListpeersPeersChann
|
||||||
impl From<pb::ListpeersPeersChannelsFunding> for responses::ListpeersPeersChannelsFunding {
|
impl From<pb::ListpeersPeersChannelsFunding> for responses::ListpeersPeersChannelsFunding {
|
||||||
fn from(c: pb::ListpeersPeersChannelsFunding) -> Self {
|
fn from(c: pb::ListpeersPeersChannelsFunding) -> Self {
|
||||||
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?
|
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
|
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
|
remote_funds_msat: c.remote_funds_msat.unwrap().into(), // Rule #1 for type msat
|
||||||
|
|
6
cln-rpc/src/model.rs
generated
6
cln-rpc/src/model.rs
generated
|
@ -1561,12 +1561,6 @@ pub mod responses {
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct ListpeersPeersChannelsFunding {
|
pub struct ListpeersPeersChannelsFunding {
|
||||||
#[deprecated]
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub local_msat: Option<Amount>,
|
|
||||||
#[deprecated]
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub remote_msat: Option<Amount>,
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub pushed_msat: Option<Amount>,
|
pub pushed_msat: Option<Amount>,
|
||||||
pub local_funds_msat: Amount,
|
pub local_funds_msat: Amount,
|
||||||
|
|
|
@ -100,8 +100,6 @@ def listpeers_peers_channels_inflight2py(m):
|
||||||
|
|
||||||
def listpeers_peers_channels_funding2py(m):
|
def listpeers_peers_channels_funding2py(m):
|
||||||
return remove_default({
|
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
|
"pushed_msat": amount2msat(m.pushed_msat), # PrimitiveField in generate_composite
|
||||||
"local_funds_msat": amount2msat(m.local_funds_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
|
"remote_funds_msat": amount2msat(m.remote_funds_msat), # PrimitiveField in generate_composite
|
||||||
|
|
|
@ -96,8 +96,6 @@ On success, an object containing **peers** is returned. It is an array of objec
|
||||||
- **funding** (object, optional):
|
- **funding** (object, optional):
|
||||||
- **local\_funds\_msat** (msat): Amount of channel we funded
|
- **local\_funds\_msat** (msat): Amount of channel we funded
|
||||||
- **remote\_funds\_msat** (msat): Amount of channel they 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
|
- **pushed\_msat** (msat, optional): Amount pushed from opener to peer
|
||||||
- **fee\_paid\_msat** (msat, optional): Amount we paid peer at open
|
- **fee\_paid\_msat** (msat, optional): Amount we paid peer at open
|
||||||
- **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open
|
- **fee\_rcvd\_msat** (msat, optional): Amount we were paid by peer at open
|
||||||
|
@ -400,4 +398,4 @@ Main web site: <https://github.com/ElementsProject/lightning> Lightning
|
||||||
RFC site (BOLT \#9):
|
RFC site (BOLT \#9):
|
||||||
<https://github.com/lightning/bolts/blob/master/09-features.md>
|
<https://github.com/lightning/bolts/blob/master/09-features.md>
|
||||||
|
|
||||||
[comment]: # ( SHA256STAMP:227b5af94d1f299a4e88e450c074960ca8d109b634e24693ad389ef02f64f525)
|
[comment]: # ( SHA256STAMP:156e5622823a8b948c0f15f694afc1d87bb5107091e5b65ee6190b4067661bb4)
|
||||||
|
|
|
@ -347,16 +347,6 @@
|
||||||
"remote_funds_msat"
|
"remote_funds_msat"
|
||||||
],
|
],
|
||||||
"properties": {
|
"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": {
|
"pushed_msat": {
|
||||||
"type": "msat",
|
"type": "msat",
|
||||||
"description": "Amount pushed from opener to peer"
|
"description": "Amount pushed from opener to peer"
|
||||||
|
|
|
@ -862,13 +862,6 @@ static void json_add_channel(struct lightningd *ld,
|
||||||
|
|
||||||
json_object_start(response, "funding");
|
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) {
|
if (channel->lease_commit_sig) {
|
||||||
struct amount_sat funds, total;
|
struct amount_sat funds, total;
|
||||||
if (!amount_msat_to_sat(&funds, channel->push)) {
|
if (!amount_msat_to_sat(&funds, channel->push)) {
|
||||||
|
@ -922,7 +915,6 @@ static void json_add_channel(struct lightningd *ld,
|
||||||
channel->our_funds);
|
channel->our_funds);
|
||||||
json_add_sat_only(response, "remote_funds_msat",
|
json_add_sat_only(response, "remote_funds_msat",
|
||||||
peer_funded_sats);
|
peer_funded_sats);
|
||||||
if (!deprecated_apis || peer)
|
|
||||||
json_add_amount_msat_only(response, "pushed_msat",
|
json_add_amount_msat_only(response, "pushed_msat",
|
||||||
channel->push);
|
channel->push);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue