lnrpc+rpcserver: add missing channel update event type
Fixes the error "unexpected channel event update" in SubscribeChannelEvents.
This commit is contained in:
4 files changed
+2173
-2127
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user