lnrpc+rpcserver: add missing channel update event type

Fixes the error "unexpected channel event update" in
SubscribeChannelEvents.
This commit is contained in:
Oliver Gugger committed 2025-07-15 17:12:17 +02:00
1 parent 7c32c667c1
commit f5b27bf057
4 files changed
+2173 -2127

No files matched your search

+2152 -2126
View File
File diff suppressed because it is too large. Load diff
+2
View File
@@ -2973,6 +2973,7 @@ message ChannelEventUpdate {
ChannelPoint inactive_channel = 4; ChannelPoint inactive_channel = 4;
PendingUpdate pending_open_channel = 6; PendingUpdate pending_open_channel = 6;
ChannelPoint fully_resolved_channel = 7; ChannelPoint fully_resolved_channel = 7;
ChannelPoint channel_funding_timeout = 8;
} }
enum UpdateType { enum UpdateType {
@@ -2982,6 +2983,7 @@ message ChannelEventUpdate {
INACTIVE_CHANNEL = 3; INACTIVE_CHANNEL = 3;
PENDING_OPEN_CHANNEL = 4; PENDING_OPEN_CHANNEL = 4;
FULLY_RESOLVED_CHANNEL = 5; FULLY_RESOLVED_CHANNEL = 5;
CHANNEL_FUNDING_TIMEOUT = 6;
} }
UpdateType type = 5; UpdateType type = 5;
+5 -1
View File
@@ -3009,7 +3009,8 @@
"ACTIVE_CHANNEL", "ACTIVE_CHANNEL",
"INACTIVE_CHANNEL", "INACTIVE_CHANNEL",
"PENDING_OPEN_CHANNEL", "PENDING_OPEN_CHANNEL",
"FULLY_RESOLVED_CHANNEL" "FULLY_RESOLVED_CHANNEL",
"CHANNEL_FUNDING_TIMEOUT"
], ],
"default": "OPEN_CHANNEL" "default": "OPEN_CHANNEL"
}, },
@@ -4480,6 +4481,9 @@
"fully_resolved_channel": { "fully_resolved_channel": {
"$ref": "#/definitions/lnrpcChannelPoint" "$ref": "#/definitions/lnrpcChannelPoint"
}, },
"channel_funding_timeout": {
"$ref": "#/definitions/lnrpcChannelPoint"
},
"type": { "type": {
"$ref": "#/definitions/ChannelEventUpdateUpdateType" "$ref": "#/definitions/ChannelEventUpdateUpdateType"
} }
+14
View File
@@ -5315,6 +5315,7 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
defer channelEventSub.Cancel() defer channelEventSub.Cancel()
for { for {
//nolint:ll
select { select {
// A new update has been sent by the channel router, we'll // A new update has been sent by the channel router, we'll
// marshal it into the form expected by the gRPC client, then // marshal it into the form expected by the gRPC client, then
@@ -5410,6 +5411,19 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
}, },
} }
case channelnotifier.FundingTimeoutEvent:
update = &lnrpc.ChannelEventUpdate{
Type: lnrpc.ChannelEventUpdate_CHANNEL_FUNDING_TIMEOUT,
Channel: &lnrpc.ChannelEventUpdate_ChannelFundingTimeout{
ChannelFundingTimeout: &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)
} }