mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 06:47:54 +01:00
Peer: invoke disconnection handlers on timeout even if we didn't successfully connect yet.
This commit is contained in:
parent
2138c8aec4
commit
a698c5846e
1 changed files with 8 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue