diff --git a/cln-grpc/proto/node.proto b/cln-grpc/proto/node.proto index 9ac4dddab..bf66a9baa 100644 --- a/cln-grpc/proto/node.proto +++ b/cln-grpc/proto/node.proto @@ -181,6 +181,7 @@ message ListpeersPeersChannels { optional bytes close_to = 14; optional bool private = 15; ChannelSide opener = 16; + optional ChannelSide closer = 17; repeated string features = 18; optional Amount to_us_msat = 20; optional Amount min_to_us_msat = 21; diff --git a/cln-grpc/src/convert.rs b/cln-grpc/src/convert.rs index d1ae7f309..a7be55089 100644 --- a/cln-grpc/src/convert.rs +++ b/cln-grpc/src/convert.rs @@ -119,6 +119,7 @@ impl From<&responses::ListpeersPeersChannels> for pb::ListpeersPeersChannels { close_to: c.close_to.as_ref().map(|v| hex::decode(&v).unwrap()), // Rule #2 for type hex? private: c.private.clone(), // Rule #2 for type boolean? opener: c.opener as i32, + closer: c.closer.map(|v| v as i32), features: c.features.iter().map(|i| i.into()).collect(), // Rule #3 for type ListpeersPeersChannelsFeatures to_us_msat: c.to_us_msat.map(|f| f.into()), // Rule #2 for type msat? min_to_us_msat: c.min_to_us_msat.map(|f| f.into()), // Rule #2 for type msat? diff --git a/cln-rpc/src/model.rs b/cln-rpc/src/model.rs index d5286569a..db51cb0e5 100644 --- a/cln-rpc/src/model.rs +++ b/cln-rpc/src/model.rs @@ -1160,6 +1160,8 @@ pub mod responses { // Path `ListPeers.peers[].channels[].opener` #[serde(rename = "opener")] pub opener: ChannelSide, + #[serde(skip_serializing_if = "Option::is_none")] + pub closer: Option, #[serde(alias = "features")] pub features: Vec, #[serde(alias = "to_us_msat", skip_serializing_if = "Option::is_none")] diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index 849b808c1..31c3d204c 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -69,7 +69,7 @@ On success, an object containing **peers** is returned. It is an array of objec - **scratch_txid** (txid): The commitment transaction txid we would use if we went onchain now - **close_to** (hex, optional): scriptPubkey which we have to close to if we mutual close - **private** (boolean, optional): if False, we will not announce this channel - - **closer** (string, optional): Who initiated the channel close (`null` is deprecated!) (one of "local", "remote", *null*) + - **closer** (string, optional): Who initiated the channel close (one of "local", "remote") - **funding** (object, optional): - **local_msat** (msat): Amount of channel we funded - **remote_msat** (msat): Amount of channel they funded @@ -380,4 +380,4 @@ Main web site: Lightning RFC site (BOLT \#9): -[comment]: # ( SHA256STAMP:6b0ec5c899c8685487190209f594635030205a275e1dc6d61a7b057adbf66192) +[comment]: # ( SHA256STAMP:4f76b5ac19d3dfdaf3d04f5dd5de2312a2ab0ccffe779508c416aaf6e644612a) diff --git a/doc/lightning-listtransactions.7.md b/doc/lightning-listtransactions.7.md index 767a92bde..157fc0126 100644 --- a/doc/lightning-listtransactions.7.md +++ b/doc/lightning-listtransactions.7.md @@ -104,4 +104,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:ba0624377601e6e90c2ca90b709fd076f3ed0f2b813f73553ec6b935eeec54a1) +[comment]: # ( SHA256STAMP:bd9c33dd27be0f25b0212b4115714768ffbec2ff6e72f083613a4464a3f98bc0) diff --git a/doc/schemas/listpeers.schema.json b/doc/schemas/listpeers.schema.json index d35091182..f50cef596 100644 --- a/doc/schemas/listpeers.schema.json +++ b/doc/schemas/listpeers.schema.json @@ -314,17 +314,12 @@ "description": "Who initiated the channel" }, "closer": { - "FIXME": "deprecated_apis turns off null!", - "type": [ - "string", - "null" - ], + "type": "string", "enum": [ "local", - "remote", - null + "remote" ], - "description": "Who initiated the channel close (`null` is deprecated!)" + "description": "Who initiated the channel close" }, "features": { "type": "array", @@ -360,12 +355,6 @@ } } }, - "funding_allocation_msat": { - "deprecated": true - }, - "funding_msat": { - "deprecated": true - }, "to_us_msat": { "type": "msat", "description": "how much of channel is owed to us" @@ -765,8 +754,6 @@ "closer": {}, "features": {}, "funding": {}, - "funding_allocation_msat": {}, - "funding_msat": {}, "to_us_msat": {}, "min_to_us_msat": {}, "max_to_us_msat": {}, @@ -817,7 +804,6 @@ "last_feerate": {}, "next_feerate": {}, "inflight": {}, - "last_tx_fee": {}, "last_tx_fee_msat": {}, "direction": {}, "close_to_addr": { @@ -854,8 +840,6 @@ "closer": {}, "features": {}, "funding": {}, - "funding_allocation_msat": {}, - "funding_msat": {}, "to_us_msat": {}, "min_to_us_msat": {}, "max_to_us_msat": {}, @@ -907,9 +891,6 @@ "next_feerate": {}, "close_to_addr": {}, "direction": {}, - "last_tx_fee": { - "deprecated": true - }, "last_tx_fee_msat": { "type": "msat", "description": "fee attached to this the current tx" @@ -944,8 +925,6 @@ "closer": {}, "features": {}, "funding": {}, - "funding_allocation_msat": {}, - "funding_msat": {}, "to_us_msat": {}, "min_to_us_msat": {}, "max_to_us_msat": {}, @@ -995,7 +974,6 @@ "initial_feerate": {}, "last_feerate": {}, "next_feerate": {}, - "last_tx_fee": {}, "close_to_addr": {}, "last_tx_fee_msat": {}, "direction": { @@ -1033,8 +1011,6 @@ "closer": {}, "features": {}, "funding": {}, - "funding_allocation_msat": {}, - "funding_msat": {}, "to_us_msat": {}, "min_to_us_msat": {}, "max_to_us_msat": {}, @@ -1082,7 +1058,6 @@ "out_msatoshi_fulfilled": {}, "htlcs": {}, "inflight": {}, - "last_tx_fee": {}, "close_to_addr": {}, "direction": {}, "last_tx_fee_msat": {}, @@ -1129,7 +1104,6 @@ "connected": {}, "htlcs": {}, "log": {}, - "last_tx_fee": {}, "netaddr": { "type": "array", "minItems": 1, diff --git a/doc/schemas/listtransactions.schema.json b/doc/schemas/listtransactions.schema.json index a5c5d5e5f..0b41b17c7 100644 --- a/doc/schemas/listtransactions.schema.json +++ b/doc/schemas/listtransactions.schema.json @@ -134,9 +134,6 @@ "type": "u32", "description": "the 0-based output number" }, - "satoshis": { - "deprecated": true - }, "msat": { "type": "msat", "description": "the amount of the output" diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 7994e6fbb..eb6fd2074 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -628,7 +628,6 @@ static void json_add_channel(struct lightningd *ld, struct channel_stats channel_stats; struct amount_msat funding_msat, peer_msats, our_msats; struct amount_sat peer_funded_sats; - struct peer *p = channel->peer; struct state_change_entry *state_changes; u32 feerate; @@ -639,9 +638,6 @@ static void json_add_channel(struct lightningd *ld, bitcoin_txid(channel->last_tx, &txid); json_add_txid(response, "scratch_txid", &txid); - if (deprecated_apis) - json_add_amount_sat_only(response, "last_tx_fee", - bitcoin_tx_compute_fee(channel->last_tx)); json_add_amount_sat_only(response, "last_tx_fee_msat", bitcoin_tx_compute_fee(channel->last_tx)); } @@ -746,8 +742,6 @@ static void json_add_channel(struct lightningd *ld, if (channel->closer != NUM_SIDES) json_add_string(response, "closer", channel->closer == LOCAL ? "local" : "remote"); - else if (deprecated_apis) - json_add_null(response, "closer"); json_array_start(response, "features"); if (channel_has(channel, OPT_STATIC_REMOTEKEY)) @@ -781,24 +775,6 @@ static void json_add_channel(struct lightningd *ld, our_msats = AMOUNT_MSAT(0); } - if (deprecated_apis) { - json_object_start(response, "funding_allocation_msat"); - json_add_u64(response, node_id_to_hexstr(tmpctx, &p->id), - peer_msats.millisatoshis); /* Raw: JSON field */ - json_add_u64(response, node_id_to_hexstr(tmpctx, &ld->id), - our_msats.millisatoshis); /* Raw: JSON field */ - json_object_end(response); - - json_object_start(response, "funding_msat"); - json_add_sat_only(response, - node_id_to_hexstr(tmpctx, &p->id), - peer_funded_sats); - json_add_sat_only(response, - node_id_to_hexstr(tmpctx, &ld->id), - channel->our_funds); - json_object_end(response); - } - json_object_start(response, "funding"); json_add_sat_only(response, "local_msat", channel->our_funds); json_add_sat_only(response, "remote_msat", peer_funded_sats); diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index fb2d3815b..9d7ad1702 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -558,8 +558,6 @@ static void json_transaction_details(struct json_stream *response, json_object_start(response, NULL); json_add_u32(response, "index", i); - if (deprecated_apis) - json_add_amount_sat_only(response, "satoshis", sat); json_add_amount_sat_only(response, "msat", sat); #if EXPERIMENTAL_FEATURES