From: mlmhl <409107750@qq.com> Date: Thu, 29 Jun 2017 01:49:55 +0000 (+0800) Subject: Do not add nodes if dht is disabled X-Git-Tag: v1.0.0~458^2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6286c11bed42c3e0d3bf4c1714f62aebf8bf62d5;p=btrtrc.git Do not add nodes if dht is disabled --- diff --git a/client.go b/client.go index 635f96de..d1cf5069 100644 --- a/client.go +++ b/client.go @@ -1331,6 +1331,9 @@ func (cl *Client) DHT() *dht.Server { } func (cl *Client) AddDHTNodes(nodes []string) { + if cl.DHT() == nil { + return + } for _, n := range nodes { hmp := missinggo.SplitHostMaybePort(n) ip := net.ParseIP(hmp.Host)