mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
watchtowers: handle closable sessions
Add a routine to the tower client that informs towers of sessions they can delete and also deletes any info about the session from the client DB.
This commit is contained in:
@ -1497,6 +1497,11 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
policy.SweepFeeRate = sweepRateSatPerVByte.FeePerKWeight()
|
||||
}
|
||||
|
||||
sessionCloseRange := uint32(wtclient.DefaultSessionCloseRange)
|
||||
if cfg.WtClient.SessionCloseRange != 0 {
|
||||
sessionCloseRange = cfg.WtClient.SessionCloseRange
|
||||
}
|
||||
|
||||
if err := policy.Validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -1516,6 +1521,8 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
|
||||
s.towerClient, err = wtclient.New(&wtclient.Config{
|
||||
FetchClosedChannel: fetchClosedChannel,
|
||||
SessionCloseRange: sessionCloseRange,
|
||||
ChainNotifier: s.cc.ChainNotifier,
|
||||
SubscribeChannelEvents: func() (subscribe.Subscription,
|
||||
error) {
|
||||
|
||||
@ -1546,6 +1553,8 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
|
||||
s.anchorTowerClient, err = wtclient.New(&wtclient.Config{
|
||||
FetchClosedChannel: fetchClosedChannel,
|
||||
SessionCloseRange: sessionCloseRange,
|
||||
ChainNotifier: s.cc.ChainNotifier,
|
||||
SubscribeChannelEvents: func() (subscribe.Subscription,
|
||||
error) {
|
||||
|
||||
|
Reference in New Issue
Block a user