mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-05 05:40:14 +00:00
Fixed race condition for link initiators on timed out link establishment
This commit is contained in:
parent
420d58527d
commit
049733c4b6
@ -277,8 +277,8 @@ class Link:
|
||||
signature = packet.data[:RNS.Identity.SIGLENGTH//8]
|
||||
|
||||
if self.destination.identity.validate(signature, signed_data):
|
||||
if self.status != Link.PENDING:
|
||||
raise IOError("Invalid link state for proof validation")
|
||||
if self.status != Link.HANDSHAKE:
|
||||
raise IOError("Invalid link state for proof validation: "+str(self.status))
|
||||
|
||||
self.rtt = time.time() - self.request_time
|
||||
self.attached_interface = packet.receiving_interface
|
||||
|
@ -1741,8 +1741,8 @@ class Transport:
|
||||
def activate_link(link):
|
||||
RNS.log("Activating link "+str(link), RNS.LOG_EXTREME)
|
||||
if link in Transport.pending_links:
|
||||
if link.status != Link.PENDING:
|
||||
raise IOError("Invalid link state for link activation")
|
||||
if link.status != RNS.Link.ACTIVE:
|
||||
raise IOError("Invalid link state for link activation: "+str(link.status))
|
||||
Transport.pending_links.remove(link)
|
||||
Transport.active_links.append(link)
|
||||
link.status = RNS.Link.ACTIVE
|
||||
|
Loading…
Reference in New Issue
Block a user