Prevent failed DHT attemps from overwriting newer peer info

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6382 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 16 years ago
parent 9324b5b6c5
commit aeab8c7917

@ -223,9 +223,20 @@ public class Transmission {
}
this.miss++;
// write information that peer does not receive index transmissions
target.setFlagAcceptRemoteIndex(false);
seeds.update(target.hash, target);
log.logInfo("Transfer failed of chunk to target " + target.hash + "/" + target.getName() + ": " + error);
// get possibly newer target Info
yacySeed newTarget = seeds.get(target.hash);
if (newTarget != null) {
String oldAddress = target.getPublicAddress();
if ((oldAddress != null) && (oldAddress.equals(newTarget.getPublicAddress()))) {
newTarget.setFlagAcceptRemoteIndex(false);
seeds.update(newTarget.hash, newTarget);
} else {
// we tried an old Address. Don't change anything
}
} else {
// target not in DB anymore. ???
}
return false;
}

Loading…
Cancel
Save