From: Matt Joiner Date: Mon, 17 Aug 2015 16:09:10 +0000 (+1000) Subject: dht: BEP43 X-Git-Tag: v1.0.0~1064 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b536975580787d27fb613733c7f35cb3f3de97de;p=btrtrc.git dht: BEP43 --- diff --git a/dht/dht.go b/dht/dht.go index 0b99d4ce..ed45395c 100644 --- a/dht/dht.go +++ b/dht/dht.go @@ -904,6 +904,11 @@ func (s *Server) query(node dHTAddr, q string, a map[string]interface{}, onRespo "q": q, "a": a, } + // BEP 43. Outgoing queries from uncontactiable nodes should contain + // "ro":1 in the top level dictionary. + if s.config.Passive { + d["ro"] = 1 + } b, err := bencode.Marshal(d) if err != nil { return