mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 21:57:54 +02:00
makeseeds: Choose node info with most recent success when deduplicating
This commit is contained in:
@@ -139,7 +139,9 @@ def dedup(ips: list[dict]) -> list[dict]:
|
||||
""" Remove duplicates from `ips` where multiple ips share address and port. """
|
||||
d = {}
|
||||
for ip in ips:
|
||||
d[ip['ip'],ip['port']] = ip
|
||||
ip_port = (ip["ip"], ip["port"])
|
||||
if ip_port not in d or ip["lastsuccess"] > d[ip_port]["lastsuccess"]:
|
||||
d[ip_port] = ip
|
||||
return list(d.values())
|
||||
|
||||
def filtermultiport(ips: list[dict]) -> list[dict]:
|
||||
|
||||
Reference in New Issue
Block a user