mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
jsonrpc: Add aliases to listpeers
result
This commit is contained in:
parent
5e74048508
commit
cdedd433a4
6 changed files with 52 additions and 1 deletions
|
@ -669,6 +669,7 @@
|
||||||
"ListPeers.peers[].netaddr[]": 5
|
"ListPeers.peers[].netaddr[]": 5
|
||||||
},
|
},
|
||||||
"ListpeersPeersChannels": {
|
"ListpeersPeersChannels": {
|
||||||
|
"ListPeers.peers[].channels[].alias": 50,
|
||||||
"ListPeers.peers[].channels[].channel_id": 6,
|
"ListPeers.peers[].channels[].channel_id": 6,
|
||||||
"ListPeers.peers[].channels[].close_to": 14,
|
"ListPeers.peers[].channels[].close_to": 14,
|
||||||
"ListPeers.peers[].channels[].close_to_addr": 47,
|
"ListPeers.peers[].channels[].close_to_addr": 47,
|
||||||
|
@ -719,6 +720,10 @@
|
||||||
"ListPeers.peers[].channels[].to_us_msat": 20,
|
"ListPeers.peers[].channels[].to_us_msat": 20,
|
||||||
"ListPeers.peers[].channels[].total_msat": 23
|
"ListPeers.peers[].channels[].total_msat": 23
|
||||||
},
|
},
|
||||||
|
"ListpeersPeersChannelsAlias": {
|
||||||
|
"ListPeers.peers[].channels[].alias.local": 1,
|
||||||
|
"ListPeers.peers[].channels[].alias.remote": 2
|
||||||
|
},
|
||||||
"ListpeersPeersChannelsFeerate": {
|
"ListpeersPeersChannelsFeerate": {
|
||||||
"ListPeers.peers[].channels[].feerate.perkb": 2,
|
"ListPeers.peers[].channels[].feerate.perkb": 2,
|
||||||
"ListPeers.peers[].channels[].feerate.perkw": 1
|
"ListPeers.peers[].channels[].feerate.perkw": 1
|
||||||
|
|
|
@ -234,6 +234,11 @@ message ListpeersPeersChannelsFunding {
|
||||||
Amount pushed_msat = 3;
|
Amount pushed_msat = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ListpeersPeersChannelsAlias {
|
||||||
|
optional string local = 1;
|
||||||
|
optional string remote = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message ListpeersPeersChannelsHtlcs {
|
message ListpeersPeersChannelsHtlcs {
|
||||||
// ListPeers.peers[].channels[].htlcs[].direction
|
// ListPeers.peers[].channels[].htlcs[].direction
|
||||||
enum ListpeersPeersChannelsHtlcsDirection {
|
enum ListpeersPeersChannelsHtlcsDirection {
|
||||||
|
|
|
@ -1071,6 +1071,14 @@ pub mod responses {
|
||||||
pub pushed_msat: Amount,
|
pub pushed_msat: Amount,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
pub struct ListpeersPeersChannelsAlias {
|
||||||
|
#[serde(alias = "local", skip_serializing_if = "Option::is_none")]
|
||||||
|
pub local: Option<ShortChannelId>,
|
||||||
|
#[serde(alias = "remote", skip_serializing_if = "Option::is_none")]
|
||||||
|
pub remote: Option<ShortChannelId>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct ListpeersPeersChannelsState_changes {
|
pub struct ListpeersPeersChannelsState_changes {
|
||||||
#[serde(alias = "timestamp")]
|
#[serde(alias = "timestamp")]
|
||||||
|
|
|
@ -92,6 +92,9 @@ On success, an object containing **peers** is returned. It is an array of objec
|
||||||
- **their_to_self_delay** (u32, optional): the number of blocks before they can take their funds if they unilateral close
|
- **their_to_self_delay** (u32, optional): the number of blocks before they can take their funds if they unilateral close
|
||||||
- **our_to_self_delay** (u32, optional): the number of blocks before we can take our funds if we unilateral close
|
- **our_to_self_delay** (u32, optional): the number of blocks before we can take our funds if we unilateral close
|
||||||
- **max_accepted_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once
|
- **max_accepted_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once
|
||||||
|
- **alias** (object, optional):
|
||||||
|
- **local** (short_channel_id, optional): An alias assigned by this node to this channel, used for outgoing payments
|
||||||
|
- **remote** (short_channel_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices
|
||||||
- **state_changes** (array of objects, optional): Prior state changes:
|
- **state_changes** (array of objects, optional): Prior state changes:
|
||||||
- **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ
|
- **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ
|
||||||
- **old_state** (string): Previous state (one of "OPENINGD", "CHANNELD_AWAITING_LOCKIN", "CHANNELD_NORMAL", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN", "ONCHAIN", "DUALOPEND_OPEN_INIT", "DUALOPEND_AWAITING_LOCKIN")
|
- **old_state** (string): Previous state (one of "OPENINGD", "CHANNELD_AWAITING_LOCKIN", "CHANNELD_NORMAL", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN", "ONCHAIN", "DUALOPEND_OPEN_INIT", "DUALOPEND_AWAITING_LOCKIN")
|
||||||
|
@ -381,4 +384,4 @@ Main web site: <https://github.com/ElementsProject/lightning> Lightning
|
||||||
RFC site (BOLT \#9):
|
RFC site (BOLT \#9):
|
||||||
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>
|
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>
|
||||||
|
|
||||||
[comment]: # ( SHA256STAMP:2e8bcc66531b2dce44b94c42852b624bdd9435cc63495fc799458fa5522f0ea9)
|
[comment]: # ( SHA256STAMP:fcfc465cbbe95430f4fc6473099142c576883e333ef9fe31d04372f411e49f6d)
|
||||||
|
|
|
@ -461,6 +461,20 @@
|
||||||
"htlc_minimum_msat": {
|
"htlc_minimum_msat": {
|
||||||
"deprecated": true
|
"deprecated": true
|
||||||
},
|
},
|
||||||
|
"alias": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [],
|
||||||
|
"properties": {
|
||||||
|
"local": {
|
||||||
|
"type": "short_channel_id",
|
||||||
|
"description": "An alias assigned by this node to this channel, used for outgoing payments"
|
||||||
|
},
|
||||||
|
"remote": {
|
||||||
|
"type": "short_channel_id",
|
||||||
|
"description": "An alias assigned by the remote node to this channel, usable in routehints and invoices"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"state_changes": {
|
"state_changes": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"description": "Prior state changes",
|
"description": "Prior state changes",
|
||||||
|
@ -664,6 +678,7 @@
|
||||||
"payment_hash": {},
|
"payment_hash": {},
|
||||||
"local_trimmed": {},
|
"local_trimmed": {},
|
||||||
"status": {},
|
"status": {},
|
||||||
|
"alias": {},
|
||||||
"state": {
|
"state": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
@ -751,6 +766,7 @@
|
||||||
"funding_outnum": {},
|
"funding_outnum": {},
|
||||||
"close_to": {},
|
"close_to": {},
|
||||||
"private": {},
|
"private": {},
|
||||||
|
"alias": {},
|
||||||
"opener": {},
|
"opener": {},
|
||||||
"closer": {},
|
"closer": {},
|
||||||
"features": {},
|
"features": {},
|
||||||
|
@ -827,6 +843,7 @@
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"state": {},
|
"state": {},
|
||||||
|
"alias": {},
|
||||||
"scratch_txid": {},
|
"scratch_txid": {},
|
||||||
"feerate": {},
|
"feerate": {},
|
||||||
"owner": {},
|
"owner": {},
|
||||||
|
@ -911,6 +928,7 @@
|
||||||
"direction"
|
"direction"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"alias": {},
|
||||||
"state": {},
|
"state": {},
|
||||||
"scratch_txid": {},
|
"scratch_txid": {},
|
||||||
"feerate": {},
|
"feerate": {},
|
||||||
|
@ -1002,6 +1020,7 @@
|
||||||
"scratch_txid": {},
|
"scratch_txid": {},
|
||||||
"feerate": {},
|
"feerate": {},
|
||||||
"owner": {},
|
"owner": {},
|
||||||
|
"alias": {},
|
||||||
"short_channel_id": {},
|
"short_channel_id": {},
|
||||||
"channel_id": {},
|
"channel_id": {},
|
||||||
"funding_txid": {},
|
"funding_txid": {},
|
||||||
|
|
|
@ -744,6 +744,17 @@ static void json_add_channel(struct lightningd *ld,
|
||||||
json_add_string(response, "closer", channel->closer == LOCAL ?
|
json_add_string(response, "closer", channel->closer == LOCAL ?
|
||||||
"local" : "remote");
|
"local" : "remote");
|
||||||
|
|
||||||
|
if (channel->alias[LOCAL] || channel->alias[REMOTE]) {
|
||||||
|
json_object_start(response, "alias");
|
||||||
|
if (channel->alias[LOCAL])
|
||||||
|
json_add_short_channel_id(response, "local",
|
||||||
|
channel->alias[LOCAL]);
|
||||||
|
if (channel->alias[REMOTE])
|
||||||
|
json_add_short_channel_id(response, "remote",
|
||||||
|
channel->alias[REMOTE]);
|
||||||
|
json_object_end(response);
|
||||||
|
}
|
||||||
|
|
||||||
json_array_start(response, "features");
|
json_array_start(response, "features");
|
||||||
if (channel_has(channel, OPT_STATIC_REMOTEKEY))
|
if (channel_has(channel, OPT_STATIC_REMOTEKEY))
|
||||||
json_add_string(response, NULL, "option_static_remotekey");
|
json_add_string(response, NULL, "option_static_remotekey");
|
||||||
|
|
Loading…
Add table
Reference in a new issue