Fix rare crash due to bad DHT node IDs
This commit is contained in:
parent
d63c5e5b98
commit
a6b5ac60ad
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue