Skip to content

Commit

Permalink
Fix rare crash due to bad DHT node IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Jun 8, 2015
1 parent d63c5e5 commit a6b5ac6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dht/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a6b5ac6

Please sign in to comment.