瀏覽代碼

pick next relay randomly in single pass for now; change this to use shared secret after everything else is done

Chelsea H. Komlo 4 年之前
父節點
當前提交
700e347ed0
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      relay.py

+ 2 - 2
relay.py

@@ -906,9 +906,9 @@ class RelayChannelManager(ChannelManager):
             self.path_selection_key, b'circuit', False, self.perfstats)
             self.path_selection_key, b'circuit', False, self.perfstats)
 
 
             logging.debug("RelayChannelManager: Unimplemented! need to translate idx into endive index")
             logging.debug("RelayChannelManager: Unimplemented! need to translate idx into endive index")
+            logging.debug("RelayChannelManager: Unimplemented! need to pick the next relay using the shared secret between the client and the relay.")
 
 
-            sys.exit("TODO convert shared secret into integer type modulo alpha")
-            nexthop = self.relaypicker.pick_relay_by_uniform_index(idx)
+            nexthop = self.relaypicker.pick_weighted_relay()
             if nexthop == None:
             if nexthop == None:
                 logging.debug("WARNING: Unimplemented! Need to validate next hop is not null, if it is, we should send a CLOSE cell.")
                 logging.debug("WARNING: Unimplemented! Need to validate next hop is not null, if it is, we should send a CLOSE cell.")