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

+14
View File
@@ -5315,6 +5315,7 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
defer channelEventSub.Cancel()
for {
//nolint:ll
select {
// A new update has been sent by the channel router, we'll
// 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:
return fmt.Errorf("unexpected channel event update: %v", event)
}