mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
lightningd: remove various deprecated JSON fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Removed: JSON-RPC: removed `listtransactions` `outputs` `satoshis` field (deprecated v0.10.1) Changelog-Removed: JSON-RPC: removed `listpeers` `channels` deprecated fields (deprecated v0.10.1) Changelog-Removed: JSON-RPC: removed `listpeers` `channels` `closer` now omitted, rather than `null` (deprecated v0.10.1)
This commit is contained in:
parent
8b62e2584f
commit
f078e54e98
9 changed files with 10 additions and 61 deletions
|
@ -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;
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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<ChannelSide>,
|
||||
#[serde(alias = "features")]
|
||||
pub features: Vec<String>,
|
||||
#[serde(alias = "to_us_msat", skip_serializing_if = "Option::is_none")]
|
||||
|
|
|
@ -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: <https://github.com/ElementsProject/lightning> Lightning
|
|||
RFC site (BOLT \#9):
|
||||
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>
|
||||
|
||||
[comment]: # ( SHA256STAMP:6b0ec5c899c8685487190209f594635030205a275e1dc6d61a7b057adbf66192)
|
||||
[comment]: # ( SHA256STAMP:4f76b5ac19d3dfdaf3d04f5dd5de2312a2ab0ccffe779508c416aaf6e644612a)
|
||||
|
|
|
@ -104,4 +104,4 @@ RESOURCES
|
|||
---------
|
||||
|
||||
Main web site: <https://github.com/ElementsProject/lightning>
|
||||
[comment]: # ( SHA256STAMP:ba0624377601e6e90c2ca90b709fd076f3ed0f2b813f73553ec6b935eeec54a1)
|
||||
[comment]: # ( SHA256STAMP:bd9c33dd27be0f25b0212b4115714768ffbec2ff6e72f083613a4464a3f98bc0)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -134,9 +134,6 @@
|
|||
"type": "u32",
|
||||
"description": "the 0-based output number"
|
||||
},
|
||||
"satoshis": {
|
||||
"deprecated": true
|
||||
},
|
||||
"msat": {
|
||||
"type": "msat",
|
||||
"description": "the amount of the output"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue