setDetectedPeer(newPeer);
}
private void setDetectedPeer(Peer newPeer) {
// Also, we need to call .equals() to propagate any DNS lookups that have been done if the two have the same domain.
Peer p = newPeer;
newPeer = newPeer.dropHostName();
if(newPeer == null) {
Logger.error(this, "Impossible: No address for detected peer! "+p+" on "+this);
return;
}
synchronized(this) {
Peer oldPeer = detectedPeer;
if((newPeer != null) && ((oldPeer == null) || !oldPeer.equals(newPeer))) {
this.detectedPeer = newPeer;
updateShortToString();
// IP has changed, it is worth looking up the DNS address again.
this.lastAttemptedHandshakeIPUpdateTime = 0;
if(!isConnected())