]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Some function doc
authorMatt Joiner <anacrolix@gmail.com>
Tue, 24 Jun 2014 13:20:07 +0000 (23:20 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 24 Jun 2014 13:20:07 +0000 (23:20 +1000)
dht/dht.go

index e7e4fd941feca7a31ba32de4aced006943a48a71..5235a72ce02d631f136da8c0f78072c7b52e0d9a 100644 (file)
@@ -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() {