dht.Server.Ping didn't lock structure

This commit is contained in:
Matt Joiner 2014-08-25 22:14:31 +10:00
parent 2d9c22ae1e
commit d17a2958a6
1 changed files with 2 additions and 0 deletions

View File

@ -483,6 +483,8 @@ func (cni *NodeInfo) UnmarshalCompact(b []byte) error {
} }
func (s *Server) Ping(node *net.UDPAddr) (*transaction, error) { func (s *Server) Ping(node *net.UDPAddr) (*transaction, error) {
s.mu.Lock()
defer s.mu.Unlock()
return s.query(node, "ping", nil) return s.query(node, "ping", nil)
} }