Description
Background
Currently the channel event stream subscribed to via gRPC SubscribeChannelEvents
will stream channel opens following the flow of lncli pendingchannels
and lncli listchannels
, meaning that first the channel event is streamed as pending open, and after the funding transaction has the required number of confirmations for the channel to be considered opened the channel open event is streamed (in addition to eventually the channel active/inactive events).
However, for channel close events this flow is different. Immediately when the closing transaction confirms the channel close event is streamed. For force channel closes this event however will always have empty resolutions, since on confirming the closing transaction eventual resolutions will not have been resolved yet. Also the channel is in fact not yet considered closed as per lncli closedchannels
, as this first happens after fully resolving the channel. A new event type FullResolved
was introduced, that is now streamed whenever the channel is fully resolved and hence actually closed, but it does only contain information on the funding transaction id.
I think on confirming a channel close transaction, a new event for pending channel close should be streamed, basically replacing the current channel close event. After resolving the channel close the actual channel close event containing the resolutions should be streamed.
Your environment
- version of
lnd
: master
Steps to reproduce
E.g. force closing a channel will immediately stream the channel close event on confirming the close transaction. Therefore the resolutions in this event will always be empty, and in fact the channel is not yet considered closed as per lncli closedchannels
, but rather as pending close as per lncli pendingchannels
.
Expected behaviour
The channel close event should first be streamed when the channel close is considered resolved.
Actual behaviour
The channel close event is streamed immediately on confirming the close transaction.