From fac4973329ff50bc554ce129b896459af9e453c2 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 9 Mar 2023 18:32:14 +0100 Subject: [PATCH] Fixed potential race condition in announce queue handling for AutoInterface --- RNS/Interfaces/AutoInterface.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RNS/Interfaces/AutoInterface.py b/RNS/Interfaces/AutoInterface.py index 13c7122..8d6d12f 100644 --- a/RNS/Interfaces/AutoInterface.py +++ b/RNS/Interfaces/AutoInterface.py @@ -214,6 +214,11 @@ class AutoInterface(Interface): else: self.receives = True + if configured_bitrate != None: + self.bitrate = configured_bitrate + else: + self.bitrate = AutoInterface.BITRATE_GUESS + peering_wait = self.announce_interval*1.2 RNS.log(str(self)+" discovering peers for "+str(round(peering_wait, 2))+" seconds...", RNS.LOG_VERBOSE) @@ -238,11 +243,6 @@ class AutoInterface(Interface): time.sleep(peering_wait) - if configured_bitrate != None: - self.bitrate = configured_bitrate - else: - self.bitrate = AutoInterface.BITRATE_GUESS - self.online = True