if !cfg.NoDHT {
dhtCfg := cfg.DHTConfig
if dhtCfg == nil {
- dhtCfg = &dht.ServerConfig{}
+ dhtCfg = &dht.ServerConfig{
+ IPBlocklist: cl.ipBlockList,
+ }
}
if dhtCfg.Addr == "" {
dhtCfg.Addr = listenAddr()
if err != nil {
return
}
- if cl.ipBlockList != nil {
- cl.dHT.SetIPBlockList(cl.ipBlockList)
- }
}
return
// Disable the DHT security extension:
// http://www.libtorrent.org/dht_sec.html.
NoSecurity bool
+ // Initial IP blocklist to use. Applied before serving and bootstrapping
+ // begins.
+ IPBlocklist *iplist.IPList
}
type ServerStats struct {
c = &ServerConfig{}
}
s = &Server{
- config: *c,
+ config: *c,
+ ipBlockList: c.IPBlocklist,
}
if c.Conn != nil {
s.socket = c.Conn