|
@@ -182,8 +182,16 @@ class Relay(network.Server):
|
|
|
# Create the CellRelay connection manager
|
|
|
self.cellrelay = CellRelay(self.netaddr, dirauthaddrs)
|
|
|
|
|
|
+ # Initially, we're not a fallback relay
|
|
|
+ self.is_fallbackrelay = False
|
|
|
+
|
|
|
self.uploaddesc()
|
|
|
|
|
|
+ def set_is_fallbackrelay(self, isfallback = True):
|
|
|
+ """Set this relay to be a fallback relay (or unset if passed
|
|
|
+ False)."""
|
|
|
+ self.is_fallbackrelay = isfallback
|
|
|
+
|
|
|
def epoch_ending(self, epoch):
|
|
|
# Download the new consensus, which will have been created
|
|
|
# already since the dirauths' epoch_ending callbacks happened
|
|
@@ -254,6 +262,8 @@ if __name__ == '__main__':
|
|
|
# relays, used by clients for bootstrapping
|
|
|
numfallbackrelays = int(numrelays * 0.05) + 1
|
|
|
fallbackrelays = random.sample(relays, numfallbackrelays)
|
|
|
+ for r in fallbackrelays:
|
|
|
+ r.set_is_fallbackrelay()
|
|
|
network.thenetwork.setfallbackrelays(fallbackrelays)
|
|
|
|
|
|
# Tick the epoch
|