lnrpc: add open and close initiator to close summary

Add an initiator enum which allows up to display an unknown value for
channels that are not in the historical chan bucket, rather than having
and ambiguous false value also representing no-value. A both option is
added to cover the case where both parties initiated a close on chain.
This commit is contained in:
carla 2020-02-21 13:24:24 +02:00
parent 4eb3036f67
commit b55470e9a9
No known key found for this signature in database
GPG key ID: 4CA7FE54A6213C91
3 changed files with 724 additions and 621 deletions

File diff suppressed because it is too large Load diff

View file

@ -1430,6 +1430,29 @@ message ChannelCloseSummary {
/// Details on how the channel was closed. /// Details on how the channel was closed.
ClosureType close_type = 10 [json_name = "close_type"]; ClosureType close_type = 10 [json_name = "close_type"];
enum Initiator {
UNKNOWN = 0;
LOCAL = 1;
REMOTE = 2;
BOTH = 3;
}
/**
Open initiator is the party that initiated opening the channel. Note that
this value may be unknown if the channel was closed before we migrated to
store open channel information after close.
*/
Initiator open_initiator = 11 [json_name = "open_initiator"];
/**
Close initiator indicates which party initiated the close. This value will
be unknown for channels that were cooperatively closed before we started
tracking cooperative close initiators. Note that this indicates which party
initiated a close, and it is possible for both to initiate cooperative or
force closes, although only one party's close will be confirmed on chain.
*/
Initiator close_initiator = 12 [json_name = "close_initiator"];
} }
message ClosedChannelsRequest { message ClosedChannelsRequest {

View file

@ -1461,6 +1461,16 @@
], ],
"default": "COOPERATIVE_CLOSE" "default": "COOPERATIVE_CLOSE"
}, },
"ChannelCloseSummaryInitiator": {
"type": "string",
"enum": [
"UNKNOWN",
"LOCAL",
"REMOTE",
"BOTH"
],
"default": "UNKNOWN"
},
"ChannelEventUpdateUpdateType": { "ChannelEventUpdateUpdateType": {
"type": "string", "type": "string",
"enum": [ "enum": [
@ -2059,6 +2069,14 @@
"close_type": { "close_type": {
"$ref": "#/definitions/ChannelCloseSummaryClosureType", "$ref": "#/definitions/ChannelCloseSummaryClosureType",
"description": "/ Details on how the channel was closed." "description": "/ Details on how the channel was closed."
},
"open_initiator": {
"$ref": "#/definitions/ChannelCloseSummaryInitiator",
"description": "*\nOpen initiator is the party that initiated opening the channel. Note that\nthis value may be unknown if the channel was closed before we migrated to\nstore open channel information after close."
},
"close_initiator": {
"$ref": "#/definitions/ChannelCloseSummaryInitiator",
"description": "*\nClose initiator indicates which party initiated the close. This value will\nbe unknown for channels that were cooperatively closed before we started\ntracking cooperative close initiators. Note that this indicates which party\ninitiated a close, and it is possible for both to initiate cooperative or\nforce closes, although only one party's close will be confirmed on chain."
} }
} }
}, },