From b536975580787d27fb613733c7f35cb3f3de97de Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 18 Aug 2015 02:09:10 +1000 Subject: [PATCH] dht: BEP43 --- dht/dht.go | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.48.1