Link activation time

This commit is contained in:
Mark Qvist 2021-12-11 17:26:45 +01:00
parent c96e067839
commit 20dfbcf0cc
2 changed files with 12 additions and 0 deletions

View file

@ -1032,6 +1032,9 @@ class Transport:
# Handling for proofs and link-request proofs
elif packet.packet_type == RNS.Packet.PROOF:
if packet.context == RNS.Packet.LRPROOF:
# TODO: Remove debug
RNS.log("Link request proof received")
# This is a link request proof, check if it
# needs to be transported
if (RNS.Reticulum.transport_enabled() or for_local_client_link or from_local_client) and packet.destination_hash in Transport.link_table:
@ -1048,10 +1051,15 @@ class Transport:
else:
RNS.log("Link request proof received on wrong interface, not transporting it.", RNS.LOG_DEBUG)
else:
# TODO: Remove debug
RNS.log("Could not transport link request proof")
# Check if we can deliver it to a local
# pending link
for link in Transport.pending_links:
if link.link_id == packet.destination_hash:
# TODO: Remove debug
RNS.log("Delivering link request proof to local pending link", RNS.LOG_DEBUG)
link.validate_proof(packet)
elif packet.context == RNS.Packet.RESOURCE_PRF: