mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
Peer: invoke disconnection handlers on timeout even if we didn't successfully connect yet.
This commit is contained in:
@@ -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
|
@Override
|
||||||
public void connectionClosed() {
|
public void connectionClosed() {
|
||||||
for (final PeerListenerRegistration registration : eventListeners) {
|
for (final PeerListenerRegistration registration : eventListeners) {
|
||||||
|
Reference in New Issue
Block a user