Fixed a race condition in link establishment flow

This commit is contained in:
Mark Qvist 2022-07-08 11:14:35 +02:00
parent da644d33ea
commit 045a9d8451

View File

@ -967,8 +967,6 @@ class Transport:
new_raw += packet.raw[2:]
outbound_interface = Transport.destination_table[packet.destination_hash][5]
Transport.transmit(outbound_interface, new_raw)
Transport.destination_table[packet.destination_hash][0] = time.time()
if packet.packet_type == RNS.Packet.LINKREQUEST:
# Entry format is
@ -991,6 +989,9 @@ class Transport:
Transport.reverse_table[packet.getTruncatedHash()] = reverse_entry
Transport.transmit(outbound_interface, new_raw)
Transport.destination_table[packet.destination_hash][0] = time.time()
else:
# TODO: There should probably be some kind of REJECT
# mechanism here, to signal to the source that their