mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 14:14:21 +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:
File diff suppressed because it is too large
Load Diff
@@ -2249,6 +2249,7 @@ message ChannelEventUpdate {
|
|||||||
ChannelPoint active_channel = 3;
|
ChannelPoint active_channel = 3;
|
||||||
ChannelPoint inactive_channel = 4;
|
ChannelPoint inactive_channel = 4;
|
||||||
PendingUpdate pending_open_channel = 6;
|
PendingUpdate pending_open_channel = 6;
|
||||||
|
ChannelPoint fully_resolved_channel = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum UpdateType {
|
enum UpdateType {
|
||||||
@@ -2257,6 +2258,7 @@ message ChannelEventUpdate {
|
|||||||
ACTIVE_CHANNEL = 2;
|
ACTIVE_CHANNEL = 2;
|
||||||
INACTIVE_CHANNEL = 3;
|
INACTIVE_CHANNEL = 3;
|
||||||
PENDING_OPEN_CHANNEL = 4;
|
PENDING_OPEN_CHANNEL = 4;
|
||||||
|
FULLY_RESOLVED_CHANNEL = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateType type = 5;
|
UpdateType type = 5;
|
||||||
|
|||||||
@@ -2327,7 +2327,8 @@
|
|||||||
"CLOSED_CHANNEL",
|
"CLOSED_CHANNEL",
|
||||||
"ACTIVE_CHANNEL",
|
"ACTIVE_CHANNEL",
|
||||||
"INACTIVE_CHANNEL",
|
"INACTIVE_CHANNEL",
|
||||||
"PENDING_OPEN_CHANNEL"
|
"PENDING_OPEN_CHANNEL",
|
||||||
|
"FULLY_RESOLVED_CHANNEL"
|
||||||
],
|
],
|
||||||
"default": "OPEN_CHANNEL"
|
"default": "OPEN_CHANNEL"
|
||||||
},
|
},
|
||||||
@@ -3306,6 +3307,9 @@
|
|||||||
"pending_open_channel": {
|
"pending_open_channel": {
|
||||||
"$ref": "#/definitions/lnrpcPendingUpdate"
|
"$ref": "#/definitions/lnrpcPendingUpdate"
|
||||||
},
|
},
|
||||||
|
"fully_resolved_channel": {
|
||||||
|
"$ref": "#/definitions/lnrpcChannelPoint"
|
||||||
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"$ref": "#/definitions/ChannelEventUpdateUpdateType"
|
"$ref": "#/definitions/ChannelEventUpdateUpdateType"
|
||||||
}
|
}
|
||||||
|
|||||||
13
rpcserver.go
13
rpcserver.go
@@ -4062,6 +4062,19 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
|
|||||||
case channelnotifier.ActiveLinkEvent:
|
case channelnotifier.ActiveLinkEvent:
|
||||||
continue
|
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:
|
default:
|
||||||
return fmt.Errorf("unexpected channel event update: %v", event)
|
return fmt.Errorf("unexpected channel event update: %v", event)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user