Cleanup and fixes

This commit is contained in:
Mark Qvist 2026-11-18 14:37:52 +01:00
parent b9903c53a8
commit 1f7cd14513
No known key found for this signature in database
2 changed files with 7 additions and 6 deletions

View file

@ -3777,16 +3777,17 @@ class Transport:
link_destination = link_entry[IDX_LT_DSTHASH]
link_traffic = link_entry[IDX_LT_TRXB]
from_interface = link_entry[IDX_LT_RCVD_IF]
from_ifhash = from_interface.get_hash()
entry = link_destinations.get(link_destination, None)
if not entry:
entry = { "active": 0, "pending": 0,
"traffic": 0, "from_ifs": set() }
"traffic": 0, "from_ifs": [] }
link_destinations[link_destination] = entry
entry["traffic"] += link_traffic
entry["from_ifs"].add(from_interface.get_hash())
if not from_ifhash in entry["from_ifs"]: entry["from_ifs"].append(from_ifhash)
if active: entry["active"] += 1
else: entry["pending"] += 1

View file

@ -512,7 +512,7 @@ def main():
parser.add_argument("-V", "--vias", action="store_true", help="show via transport IDs", default=False)
parser.add_argument("-E", "--expiry", action="store_true", help="show path expiry times", default=False)
parser.add_argument("-m", "--max", action="store", metavar="hops", type=int, help="maximum hops to filter path table by", default=None)
parser.add_argument("-M", "--min-value", action="store", metavar="hops", type=float, help="minimum value to filter path table by", default=None)
parser.add_argument("-M", "--min-value", action="store", metavar="value", type=float, help="minimum value to filter path table by", default=None)
parser.add_argument("-r", "--rates", action="store_true", help="show announce rate info", default=False)
parser.add_argument("-d", "--drop", action="store_true", help="remove the path to a destination", default=False)
parser.add_argument("-D", "--drop-announces", action="store_true", help="drop all queued announces", default=False)
@ -524,12 +524,12 @@ def main():
parser.add_argument("-b", "--blackholed", action="store_true", help="list blackholed identities", default=False)
parser.add_argument("-B", "--blackhole", action="store_true", help="blackhole identity", default=False)
parser.add_argument("-U", "--unblackhole", action="store_true", help="unblackhole identity", default=False)
parser.add_argument( "--duration", action="store", type=float, help="duration of blackhole enforcement in hours", default=None)
parser.add_argument( "--reason", action="store", type=str, help="reason for blackholing identity", default=None)
parser.add_argument( "--duration", action="store", metavar="hours", type=float, help="duration of blackhole enforcement in hours", default=None)
parser.add_argument( "--reason", action="store", metavar="reason", type=str, help="reason for blackholing identity", default=None)
parser.add_argument("-p", "--blackholed-list", action="store_true", help="view published blackhole list for remote transport instance", default=False)
parser.add_argument("-j", "--json", action="store_true", help="output in JSON format", default=False)
parser.add_argument("-A", "--analyze", action="store_true", help="Analyze tables", default=False)
parser.add_argument("--capture", action="store", metavar="hops", type=str, help="path to capture file for analyze mode", default=None)
parser.add_argument("--capture", action="store", metavar="path", type=str, help="path to capture file for analyze mode", default=None)
parser.add_argument("destination", nargs="?", default=None, help="hexadecimal hash of the destination", type=str)
parser.add_argument("list_filter", nargs="?", default=None, help="filter for remote blackhole list view", type=str)
parser.add_argument('-v', '--verbose', action='count', default=0)