mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-26 22:17:51 +01:00
channeldb+server: prune link nodes on startup
In this commit, we extend the server's functionality to prune link nodes on startup. Since we currently only decide whether to prune a link node from the database based on a channel close, it's possible that we have link nodes lingering from before this functionality was added on.
This commit is contained in:
@@ -759,7 +759,12 @@ func (s *server) Start() error {
|
||||
|
||||
// With all the relevant sub-systems started, we'll now attempt to
|
||||
// establish persistent connections to our direct channel collaborators
|
||||
// within the network.
|
||||
// within the network. Before doing so however, we'll prune our set of
|
||||
// link nodes found within the database to ensure we don't reconnect to
|
||||
// any nodes we no longer have open channels with.
|
||||
if err := s.chanDB.PruneLinkNodes(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.establishPersistentConnections(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user