Fixed race condition in outbound handling packet filter

This commit is contained in:
Mark Qvist 2021-08-21 19:42:01 +02:00
parent 242941fec4
commit af890d91d2

View File

@ -391,13 +391,14 @@ class Transport:
if should_transmit: if should_transmit:
RNS.log("Transmitting "+str(len(packet.raw))+" bytes on: "+str(interface), RNS.LOG_EXTREME) RNS.log("Transmitting "+str(len(packet.raw))+" bytes on: "+str(interface), RNS.LOG_EXTREME)
RNS.log("Hash is "+RNS.prettyhexrep(packet.packet_hash), RNS.LOG_EXTREME) RNS.log("Hash is "+RNS.prettyhexrep(packet.packet_hash), RNS.LOG_EXTREME)
if not packet.packet_hash in Transport.packet_hashlist:
Transport.packet_hashlist.append(packet.packet_hash)
interface.processOutgoing(packet.raw) interface.processOutgoing(packet.raw)
sent = True sent = True
if sent: if sent:
packet.sent = True packet.sent = True
packet.sent_at = time.time() packet.sent_at = time.time()
Transport.packet_hashlist.append(packet.packet_hash)
# Don't generate receipt if it has been explicitly disabled # Don't generate receipt if it has been explicitly disabled
if (packet.create_receipt == True and if (packet.create_receipt == True and