NetDb: Look in all SSU addresses for introducers in the expiration check

This commit is contained in:
zzz
2016-03-01 13:42:03 +00:00
parent 50d038af5d
commit 1f088ff3e5
2 changed files with 3 additions and 4 deletions

View File

@@ -187,7 +187,7 @@ public class RouterInfo extends DatabaseEntry {
* @return unmodifiable view, non-null
*/
public Collection<RouterAddress> getAddresses() {
return Collections.unmodifiableCollection(_addresses);
return Collections.unmodifiableList(_addresses);
}
/**

View File

@@ -984,9 +984,8 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
// And even better, catches the case where the router is unreachable but knows no introducers
if (routerInfo.getCapabilities().indexOf(Router.CAPABILITY_UNREACHABLE) >= 0)
return "Old peer and thinks it is unreachable";
// FIXME check all SSU addresses, not just first
RouterAddress ra = routerInfo.getTargetAddress("SSU");
if (ra != null) {
// Just check all the addresses, faster than getting just the SSU ones
for (RouterAddress ra : routerInfo.getAddresses()) {
// Introducers change often, introducee will ping introducer for 2 hours
if (ra.getOption("ihost0") != null)
return "Old peer with SSU Introducers";