diff --git a/RNS/Identity.py b/RNS/Identity.py index 7c746eca..dc631324 100644 --- a/RNS/Identity.py +++ b/RNS/Identity.py @@ -735,8 +735,9 @@ class Identity: signal_str += "]" else: signal_str = "" - if r["transport_id"] != None: RNS.log("Valid announce for "+RNS.prettyhexrep(r["destination_hash"])+" "+str(r["hops"])+" hops away, received via "+RNS.prettyhexrep(r["transport_id"])+" on "+str(r["receiving_interface"])+signal_str, valid_announce_loglevel) - else: RNS.log("Valid announce for "+RNS.prettyhexrep(r["destination_hash"])+" "+str(r["hops"])+" hops away, received on "+str(r["receiving_interface"])+signal_str, valid_announce_loglevel) + via_str = f" via {RNS.prettyhexrep(r['transport_id'])}" if r["transport_id"] else "" + val_str = f" (v:{RNS.prettycost(r['stamp_value'])})" + RNS.log(f"Valid announce for {RNS.prettyhexrep(r['destination_hash'])}{val_str} {r['hops']} hops away, received{via_str} on {r['receiving_interface']}{signal_str}", valid_announce_loglevel) return True diff --git a/RNS/Transport.py b/RNS/Transport.py index 7ffc8217..1470048b 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -2725,7 +2725,7 @@ class Transport: Transport.mark_path_unknown_state(packet.destination_hash) if RNS.sl(RNS.LOG_PATHING): destination_value = RNS.Identity.recall_stamp_value(packet.destination_hash) - value_str = f" (v:{destination_value})" if destination_value else " (v:n)" + value_str = f" (v:{RNS.prettycost(destination_value)})" if destination_value else " (v:n)" RNS.log(f"Destination {RNS.prettyhexrep(packet.destination_hash)}{value_str} is now {announce_hops} hops away via {RNS.prettyhexrep(received_from)} on {packet.receiving_interface}", RNS.LOG_PATHING) if packet.destination_hash in Transport.path_requests: diff --git a/RNS/__init__.py b/RNS/__init__.py index 8a1f24dd..569a231c 100755 --- a/RNS/__init__.py +++ b/RNS/__init__.py @@ -181,8 +181,8 @@ def prettyhexrep(data): return hexrep def prettycost(value): - if value == None: return "?" - elif not type(value) in (float, int): return "?" + if value == None: return "n" + elif not type(value) in (float, int): return "n" else: return f"{quantize_cost(value):.3f}" def prettyspeed(num, suffix="b"):