server.go
func (s *Server) findNode(addr Addr, targetID int160, callback func(krpc.Msg, error)) (err error) {
	return s.query(addr, "find_node", &krpc.MsgArgs{
		Target: targetID.AsByteArray(),
		Want:   []krpc.Want{krpc.WantNodes, krpc.WantNodes6},
	}, func(m krpc.Msg, err error) {
		// Scrape peers from the response to put in the server's table before
		// handing the response back to the caller.
		s.mu.Lock()
		s.addResponseNodes(m)
		s.mu.Unlock()
		callback(m, err)
	})
}
func (s *Server) findNode(addr Addr, targetID int160, callback func(krpc.Msg, error)) (err error) {
	return s.query(addr, "find_node", &krpc.MsgArgs{
		Target: targetID.AsByteArray(),
		Want:   []krpc.Want{krpc.WantNodes, krpc.WantNodes6},
	}, func(m krpc.Msg, err error) {
		// Scrape peers from the response to put in the server's table before
		// handing the response back to the caller.
		s.mu.Lock()
		s.addResponseNodes(m)
		s.mu.Unlock()
		callback(m, err)
	})
}
func ( s * Server ) findNode ( addr Addr , targetID int160 , callback func ( krpc . Msg , error ) ) ( err error ) { return s . query ( addr , " " , & krpc . MsgArgs { Target : targetID . AsByteArray ( ) , Want : [ ] krpc . Want { krpc . WantNodes , krpc . WantNodes6 } , } , func ( m krpc . Msg , err error ) { // Scrape peers from the response to put in the server's table before // handing the response back to the caller. s . mu . Lock ( ) s . addResponseNodes ( m ) s . mu . Unlock ( ) callback ( m , err ) } ) }
// Sends a find_node query to addr. targetID is the node we're looking for.
Sends a find_node query to addr . targetID is the node we re looking for .