-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Augment the PendingChannels RPC to also show which channels are being closed #140
Copy link
Copy link
Closed
Labels
channel closingRelated to the closing of channels cooperatively and uncooperativelyRelated to the closing of channels cooperatively and uncooperativelydatabaseRelated to the database/storage of LNDRelated to the database/storage of LNDenhancementImprovements to existing features / behaviourImprovements to existing features / behaviourintermediateIssues suitable for developers moderately familiar with the codebase and LNIssues suitable for developers moderately familiar with the codebase and LNrpcRelated to the RPC interfaceRelated to the RPC interface
Milestone
Metadata
Metadata
Assignees
Labels
channel closingRelated to the closing of channels cooperatively and uncooperativelyRelated to the closing of channels cooperatively and uncooperativelydatabaseRelated to the database/storage of LNDRelated to the database/storage of LNDenhancementImprovements to existing features / behaviourImprovements to existing features / behaviourintermediateIssues suitable for developers moderately familiar with the codebase and LNIssues suitable for developers moderately familiar with the codebase and LNrpcRelated to the RPC interfaceRelated to the RPC interface
There exist three states of pending funds within
lndas it's writen today:Nconfirmations.Tblocks have passed, and the time-lock sweeping transaction enters the chain.Currently the
PendingChannelsRPC only shows the channels that are about to be opened and are awaitingNconfirmations before they're considered open. The proto itselfPendingChannelResponseincludes an enum for each pending channel which tells if the channel is being opened or closed. Currently, only channels that are in the process of being opened are display in the response to the request. In order to give higher level applications and wallets more visibility into the various states that funds withinlndcan idle in, the RPC response should be extended to display more granular information w.r.t "pending funds" inlnd's wallet.Steps To Completion
dbbucket)within the database to also include the following information:CloseChannelwhich toggles if the channel was closed forcibly or cooperatively.MarkChannelPendingandMarkChannelOpenmethods for thechanneldb.OpenChannelstruct. Once the channel has been fully closed, then most of the limbo balance data in the close channel bucket can safely be deleted, and replaced with either: just the closing txtxid, and the closingtxid+ the sweeping channeltxid.PendingChannelsRPC should be expanded to scan the database for channels still actively undergoing closing, and populate the RPC's accordingly based off of this data. This will populate the item listed as#2in the list above.peerstruct, and theutxoNursery.peerstruct initiates a cooperative channel closure, the target channel should be marked as closed.utxoNurserygraduates (sweeps) a set of outputs, the channels swept would me themselves marked as closed.