]> Sergey Matveev's repositories - btrtrc.git/commitdiff
dht: Use passive from server config
authorMatt Joiner <anacrolix@gmail.com>
Mon, 17 Aug 2015 16:11:48 +0000 (02:11 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 17 Aug 2015 16:11:48 +0000 (02:11 +1000)
dht/dht.go

index bca1c7783a41dfc7400690def0e307fd39868908..db886b46ea5df83846f25aff6d43c52aa6839722 100644 (file)
@@ -50,7 +50,6 @@ type Server struct {
        nodes            map[string]*node // Keyed by dHTAddr.String().
        mu               sync.Mutex
        closed           chan struct{}
-       passive          bool // Don't respond to queries.
        ipBlockList      *iplist.IPList
        badNodes         *boom.BloomFilter
 
@@ -139,7 +138,6 @@ func NewServer(c *ServerConfig) (s *Server, err error) {
                        return
                }
        }
-       s.passive = c.Passive
        s.bootstrapNodes = c.BootstrapNodes
        err = s.init()
        if err != nil {
@@ -722,7 +720,7 @@ func (s *Server) handleQuery(source dHTAddr, m Msg) {
        node.SetIDFromString(args["id"].(string))
        node.lastGotQuery = time.Now()
        // Don't respond.
-       if s.passive {
+       if s.config.Passive {
                return
        }
        switch m["q"] {