3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-11 17:55:53 +00:00

Peer: invoke disconnection handlers on timeout even if we didn't successfully connect yet.

This commit is contained in:
Mike Hearn 2015-01-21 16:45:03 +01:00
parent 2138c8aec4
commit a698c5846e

View File

@ -276,6 +276,14 @@ public class Peer extends PeerSocketHandler {
}
}
@Override
protected void timeoutOccurred() {
super.timeoutOccurred();
if (!connectionOpenFuture.isDone()) {
connectionClosed(); // Invoke the event handlers to tell listeners e.g. PeerGroup that we never managed to connect.
}
}
@Override
public void connectionClosed() {
for (final PeerListenerRegistration registration : eventListeners) {