mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-11-25 09:26:24 -05:00
Cleanup
This commit is contained in:
parent
d2dd730801
commit
d3ec00cd51
1 changed files with 10 additions and 7 deletions
|
|
@ -192,8 +192,8 @@ class Transport:
|
||||||
STAMP_DESTINATIONS = False # Whether to stamp destination announces emitted from this instance
|
STAMP_DESTINATIONS = False # Whether to stamp destination announces emitted from this instance
|
||||||
STAMP_PRS = False # Whether to stamp path requests emitted from this instance
|
STAMP_PRS = False # Whether to stamp path requests emitted from this instance
|
||||||
STAMP_COST_CAP = 100 # Global hard cap on stamp cost to ensure search-space viability at 14-byte stamp sizes
|
STAMP_COST_CAP = 100 # Global hard cap on stamp cost to ensure search-space viability at 14-byte stamp sizes
|
||||||
DESTINATION_COST = 20 # Default required announce cost if no specifics configured or determined
|
DESTINATION_COST = 23 # Default required announce cost if no specifics configured or determined
|
||||||
DESTINATION_VALUE = 20 # Default target stamp value for emitted announces
|
DESTINATION_VALUE = 23 # Default target stamp value for emitted announces
|
||||||
PR_COST = 19 # Default required path request cost if no specifics configured or determined
|
PR_COST = 19 # Default required path request cost if no specifics configured or determined
|
||||||
PR_VALUE = 19 # Default target stamp value for emitted path requests
|
PR_VALUE = 19 # Default target stamp value for emitted path requests
|
||||||
|
|
||||||
|
|
@ -1015,6 +1015,7 @@ class Transport:
|
||||||
else:
|
else:
|
||||||
if time.time() > link_entry[IDX_LT_PROOF_TMO]:
|
if time.time() > link_entry[IDX_LT_PROOF_TMO]:
|
||||||
stale_links.append(link_id)
|
stale_links.append(link_id)
|
||||||
|
blocked_if = None
|
||||||
|
|
||||||
last_path_request = 0
|
last_path_request = 0
|
||||||
with Transport.path_requests_lock:
|
with Transport.path_requests_lock:
|
||||||
|
|
@ -1451,8 +1452,9 @@ class Transport:
|
||||||
if destination_hash:
|
if destination_hash:
|
||||||
if blocked_if == None: Transport.request_path(destination_hash)
|
if blocked_if == None: Transport.request_path(destination_hash)
|
||||||
else:
|
else:
|
||||||
|
request_tag = RNS.Identity.get_random_hash()
|
||||||
for interface in Transport.interfaces:
|
for interface in Transport.interfaces:
|
||||||
if interface != blocked_if: Transport.request_path(destination_hash, on_interface=interface)
|
if interface != blocked_if: Transport.request_path(destination_hash, on_interface=interface, tag=request_tag)
|
||||||
else: pass
|
else: pass
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3818,7 +3820,7 @@ class Transport:
|
||||||
request_tag = RNS.Identity.get_random_hash()
|
request_tag = RNS.Identity.get_random_hash()
|
||||||
for interface in Transport.interfaces:
|
for interface in Transport.interfaces:
|
||||||
if not interface == attached_interface:
|
if not interface == attached_interface:
|
||||||
Transport.request_path(destination_hash, interface, tag = request_tag)
|
Transport.request_path(destination_hash, interface, tag=request_tag)
|
||||||
|
|
||||||
elif should_search_for_unknown:
|
elif should_search_for_unknown:
|
||||||
with Transport.discovery_pr_lock:
|
with Transport.discovery_pr_lock:
|
||||||
|
|
@ -3876,12 +3878,13 @@ class Transport:
|
||||||
elif not is_from_local_client and len(Transport.local_client_interfaces) > 0:
|
elif not is_from_local_client and len(Transport.local_client_interfaces) > 0:
|
||||||
# Forward the path request on all local
|
# Forward the path request on all local
|
||||||
# client interfaces
|
# client interfaces
|
||||||
RNS.log("Forwarding path request for "+RNS.prettyhexrep(destination_hash)+interface_str+" to local clients", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
|
RNS.log(f"Forwarding path request for {RNS.prettyhexrep(destination_hash)}{interface_str} to local clients", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
|
||||||
|
request_tag = RNS.Identity.get_random_hash()
|
||||||
for interface in Transport.local_client_interfaces:
|
for interface in Transport.local_client_interfaces:
|
||||||
Transport.request_path(destination_hash, on_interface=interface)
|
Transport.request_path(destination_hash, on_interface=interface, tag=request_tag)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
RNS.log("Ignoring path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", no path known", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
|
RNS.log(f"Ignoring path request for {RNS.prettyhexrep(destination_hash)}{interface_str}, no path known", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
|
||||||
|
|
||||||
if answered:
|
if answered:
|
||||||
# Resolve potential in-flight path requests
|
# Resolve potential in-flight path requests
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue