mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
lnrpc+rpcserver: add new fully resolved chan update event
This commit adds the new channel update event for a channel that is now fully resolved to the event subscription RPC.
This commit is contained in:
parent
5917486dc9
commit
06a693f10e
4 changed files with 1651 additions and 1606 deletions
File diff suppressed because it is too large
Load diff
|
@ -2249,6 +2249,7 @@ message ChannelEventUpdate {
|
|||
ChannelPoint active_channel = 3;
|
||||
ChannelPoint inactive_channel = 4;
|
||||
PendingUpdate pending_open_channel = 6;
|
||||
ChannelPoint fully_resolved_channel = 7;
|
||||
}
|
||||
|
||||
enum UpdateType {
|
||||
|
@ -2257,6 +2258,7 @@ message ChannelEventUpdate {
|
|||
ACTIVE_CHANNEL = 2;
|
||||
INACTIVE_CHANNEL = 3;
|
||||
PENDING_OPEN_CHANNEL = 4;
|
||||
FULLY_RESOLVED_CHANNEL = 5;
|
||||
}
|
||||
|
||||
UpdateType type = 5;
|
||||
|
|
|
@ -2327,7 +2327,8 @@
|
|||
"CLOSED_CHANNEL",
|
||||
"ACTIVE_CHANNEL",
|
||||
"INACTIVE_CHANNEL",
|
||||
"PENDING_OPEN_CHANNEL"
|
||||
"PENDING_OPEN_CHANNEL",
|
||||
"FULLY_RESOLVED_CHANNEL"
|
||||
],
|
||||
"default": "OPEN_CHANNEL"
|
||||
},
|
||||
|
@ -3306,6 +3307,9 @@
|
|||
"pending_open_channel": {
|
||||
"$ref": "#/definitions/lnrpcPendingUpdate"
|
||||
},
|
||||
"fully_resolved_channel": {
|
||||
"$ref": "#/definitions/lnrpcChannelPoint"
|
||||
},
|
||||
"type": {
|
||||
"$ref": "#/definitions/ChannelEventUpdateUpdateType"
|
||||
}
|
||||
|
|
13
rpcserver.go
13
rpcserver.go
|
@ -4062,6 +4062,19 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
|
|||
case channelnotifier.ActiveLinkEvent:
|
||||
continue
|
||||
|
||||
case channelnotifier.FullyResolvedChannelEvent:
|
||||
update = &lnrpc.ChannelEventUpdate{
|
||||
Type: lnrpc.ChannelEventUpdate_FULLY_RESOLVED_CHANNEL,
|
||||
Channel: &lnrpc.ChannelEventUpdate_FullyResolvedChannel{
|
||||
FullyResolvedChannel: &lnrpc.ChannelPoint{
|
||||
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
|
||||
FundingTxidBytes: event.ChannelPoint.Hash[:],
|
||||
},
|
||||
OutputIndex: event.ChannelPoint.Index,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unexpected channel event update: %v", event)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue