watchtower: add ListClosableSessions method

This commit adds a new ListClosableSessions method to the tower client
DB. This method will return a map of sessionIDs to block heights. The
IDs belong to sessions that are considered closable and the block
heights are the block height at which the last associated channel for
the session was closed in.
This commit is contained in:
Elle Mouton committed 2023-03-20 10:46:52 +02:00
1 parent 571966440c
commit 3577c829d3
4 files changed
+75 -1

No files matched your search

+4
View File
@@ -95,6 +95,10 @@ type DB interface {
MarkChannelClosed(chanID lnwire.ChannelID, blockHeight uint32) (
[]wtdb.SessionID, error)
// ListClosableSessions fetches and returns the IDs for all sessions
// marked as closable.
ListClosableSessions() (map[wtdb.SessionID]uint32, 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