lnd: pass through neutrino MaxPeers config
This enables users to set the config. We check that the currently set value of MaxPeers is non-zero.
This commit is contained in:
4 files changed
+14
-6
No files matched your search
+5
-1
@@ -1528,7 +1528,11 @@ func initNeutrinoBackend(ctx context.Context, cfg *Config, chainDir string,
|
||||
PersistToDisk: cfg.NeutrinoMode.PersistFilters,
|
||||
}
|
||||
|
||||
neutrino.MaxPeers = 8
|
||||
if cfg.NeutrinoMode.MaxPeers <= 0 {
|
||||
return nil, nil, fmt.Errorf("a non-zero number must be set " +
|
||||
"for neutrino max peers")
|
||||
}
|
||||
neutrino.MaxPeers = cfg.NeutrinoMode.MaxPeers
|
||||
neutrino.BanDuration = time.Hour * 48
|
||||
neutrino.UserAgentName = cfg.NeutrinoMode.UserAgentName
|
||||
neutrino.UserAgentVersion = cfg.NeutrinoMode.UserAgentVersion
|
||||
|
||||
Reference in new issue
Block a user