retry hosts received from hostcache even if marked as failed

This commit is contained in:
Zlatin Balevsky
2019-06-05 20:58:28 +01:00
parent c07d351c5d
commit 6782849a12
3 changed files with 6 additions and 5 deletions

View File

@@ -140,7 +140,7 @@ class CacheClient {
pong.pongs.asList().each {
Destination dest = new Destination(it)
if (!session.getMyDestination().equals(dest))
eventBus.publish(new HostDiscoveredEvent(destination: dest))
eventBus.publish(new HostDiscoveredEvent(destination: dest, fromHostcache : true))
}
}

View File

@@ -46,8 +46,8 @@ class HostCache extends Service {
void onHostDiscoveredEvent(HostDiscoveredEvent e) {
if (myself == e.destination)
return
if (hosts.containsKey(e.destination))
return
if (hosts.containsKey(e.destination) && !e.fromHostcache)
return
Host host = new Host(e.destination)
if (allowHost(host)) {
hosts.put(e.destination, host)

View File

@@ -7,9 +7,10 @@ import net.i2p.data.Destination
class HostDiscoveredEvent extends Event {
Destination destination
boolean fromHostcache
@Override
public String toString() {
"HostDiscoveredEvent ${super.toString()} destination:${destination.toBase32()}"
"HostDiscoveredEvent ${super.toString()} destination:${destination.toBase32()} from hostcache $fromHostcache"
}
}