From: Matt Joiner Date: Tue, 24 Jun 2014 13:20:07 +0000 (+1000) Subject: Some function doc X-Git-Tag: v1.0.0~1713 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=75e34be89d08b9d7bd30bb16e10af42d101d1000;p=btrtrc.git Some function doc --- diff --git a/dht/dht.go b/dht/dht.go index e7e4fd94..5235a72c 100644 --- a/dht/dht.go +++ b/dht/dht.go @@ -330,11 +330,14 @@ func (me *findNodeResponse) UnmarshalKRPCMsg(m Msg) error { return nil } +// Sends a find_node query to addr. targetID is the node we're looking for. func (s *Server) FindNode(addr *net.UDPAddr, targetID string) (t *transaction, err error) { t, err = s.query(addr, "find_node", map[string]string{"target": targetID}) if err != nil { return } + // Scrape peers from the response to put in the server's table before + // handing the response back to the caller. ch := make(chan Msg) t.response = ch go func() {