watchtower: add MarkChannelClosed db method
This commit adds a `MarkChannelClosed` method to the tower client DB. This function can be called when a channel is closed and it will check the channel's associated sessions to see if any of them are "closable". Any closable sessions are added to a new `cClosableSessionsBkt` bucket so that they can be evaluated in future. Note that only the logic for this function is added in this commit and it is not yet called.
This commit is contained in:
4 files changed
+553
-14
No files matched your search
@@ -86,6 +86,15 @@ type DB interface {
|
||||
// their channel summaries.
|
||||
FetchChanSummaries() (wtdb.ChannelSummaries, error)
|
||||
|
||||
// MarkChannelClosed will mark a registered channel as closed by setting
|
||||
// its closed-height as the given block height. It returns a list of
|
||||
// session IDs for sessions that are now considered closable due to the
|
||||
// close of this channel. The details for this channel will be deleted
|
||||
// from the DB if there are no more sessions in the DB that contain
|
||||
// updates for this channel.
|
||||
MarkChannelClosed(chanID lnwire.ChannelID, blockHeight uint32) (
|
||||
[]wtdb.SessionID, error)
|
||||
|
||||
// RegisterChannel registers a channel for use within the client
|
||||
// database. For now, all that is stored in the channel summary is the
|
||||
// sweep pkscript that we'd like any tower sweeps to pay into. In the
|
||||
|
||||
Reference in new issue
Block a user