mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 16:32:47 +00:00
makeseeds: Choose node info with most recent success when deduplicating
This commit is contained in:
parent
982883a1bc
commit
27fbdb009f
@ -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]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user