]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix rare crash due to bad DHT node IDs
authorMatt Joiner <anacrolix@gmail.com>
Mon, 8 Jun 2015 08:16:29 +0000 (18:16 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 8 Jun 2015 08:16:29 +0000 (18:16 +1000)
dht/dht.go

index 3f4377307f99dd17fa7d35c45039b1c64229b21d..d60fd481195f0abdc90d79233ecf04e3011ac007 100644 (file)
@@ -772,7 +772,7 @@ func (s *Server) getNode(addr dHTAddr, id string) (n *node) {
        n = &node{
                addr: addr,
        }
-       if id != "" {
+       if len(id) == 20 {
                n.SetIDFromString(id)
        }
        if len(s.nodes) >= maxNodes {