mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-05 01:10:21 +02:00
multi: add default watchtower config to main LND config
In this commit, a `DefaultWatchtowerCfg` function is added which is used to construct a default `lncfg.Watchtower` struct. This is then used to populate the default watchtower config in the main LND config struct.
This commit is contained in:
parent
d9c4ada991
commit
f3525e8b7c
@ -638,9 +638,7 @@ func DefaultConfig() Config {
|
|||||||
ChannelCacheSize: channeldb.DefaultChannelCacheSize,
|
ChannelCacheSize: channeldb.DefaultChannelCacheSize,
|
||||||
},
|
},
|
||||||
Prometheus: lncfg.DefaultPrometheus(),
|
Prometheus: lncfg.DefaultPrometheus(),
|
||||||
Watchtower: &lncfg.Watchtower{
|
Watchtower: lncfg.DefaultWatchtowerCfg(defaultTowerDir),
|
||||||
TowerDir: defaultTowerDir,
|
|
||||||
},
|
|
||||||
HealthChecks: &lncfg.HealthCheckConfig{
|
HealthChecks: &lncfg.HealthCheckConfig{
|
||||||
ChainCheck: &lncfg.CheckConfig{
|
ChainCheck: &lncfg.CheckConfig{
|
||||||
Interval: defaultChainInterval,
|
Interval: defaultChainInterval,
|
||||||
|
@ -13,3 +13,14 @@ type Watchtower struct {
|
|||||||
|
|
||||||
watchtower.Conf
|
watchtower.Conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultWatchtowerCfg creates a Watchtower with some default values filled
|
||||||
|
// out.
|
||||||
|
func DefaultWatchtowerCfg(defaultTowerDir string) *Watchtower {
|
||||||
|
conf := watchtower.DefaultConf()
|
||||||
|
|
||||||
|
return &Watchtower{
|
||||||
|
TowerDir: defaultTowerDir,
|
||||||
|
Conf: *conf,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -23,6 +23,14 @@ type Conf struct {
|
|||||||
WriteTimeout time.Duration `long:"writetimeout" description:"Duration the watchtower server will wait for messages to be written before hanging up on client connections"`
|
WriteTimeout time.Duration `long:"writetimeout" description:"Duration the watchtower server will wait for messages to be written before hanging up on client connections"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultConf returns a Conf with some default values filled in.
|
||||||
|
func DefaultConf() *Conf {
|
||||||
|
return &Conf{
|
||||||
|
ReadTimeout: DefaultReadTimeout,
|
||||||
|
WriteTimeout: DefaultWriteTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Apply completes the passed Config struct by applying any parsed Conf options.
|
// Apply completes the passed Config struct by applying any parsed Conf options.
|
||||||
// If the corresponding values parsed by Conf are already set in the Config,
|
// If the corresponding values parsed by Conf are already set in the Config,
|
||||||
// those fields will be not be modified.
|
// those fields will be not be modified.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user