Browse Source

Clients and relays verify consensuses when they receive them

Ian Goldberg 4 years ago
parent
commit
4823ecc5cc
2 changed files with 2 additions and 0 deletions
  1. 1 0
      client.py
  2. 1 0
      relay.py

+ 1 - 0
client.py

@@ -25,6 +25,7 @@ class CellClient(relay.CellHandler):
         print("Client %s received msg %s from %s" % (self.myaddr, msg, peeraddr))
         if isinstance(msg, relay.RelayConsensusMsg):
             self.consensus = msg.consensus
+            dirauth.verify_consensus(self.consensus, network.thenetwork.dirauthkeys())
         else:
             return super().received_msg(msg, peeraddr, peer)
 

+ 1 - 0
relay.py

@@ -169,6 +169,7 @@ class CellRelay(CellHandler):
         a = random.choice(self.dirauthaddrs)
         c = network.thenetwork.connect(self, a)
         self.consensus = c.getconsensus()
+        dirauth.verify_consensus(self.consensus, network.thenetwork.dirauthkeys())
         c.close()
 
     def received_msg(self, msg, peeraddr, peer):