mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-18 14:55:53 -04:00
Shutdown peer in BootstrappedPeerFactory in case of bootstrap is still in progress (#270)\n\n Te other shutdown call in TomP2PNode would not trigger a shutdown as the peer is null during bootstrap
This commit is contained in:
parent
9517c7ee6d
commit
b85317c8f3
@ -23,6 +23,7 @@ import io.bitsquare.network.BootstrapNodes;
|
||||
import io.bitsquare.network.ClientNode;
|
||||
import io.bitsquare.network.Node;
|
||||
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.name.Names;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@ -65,6 +66,13 @@ public class TomP2PMessageModule extends MessageModule {
|
||||
bind(BootstrappedPeerFactory.class).asEagerSingleton();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doClose(Injector injector) {
|
||||
super.doClose(injector);
|
||||
|
||||
injector.getInstance(BootstrappedPeerFactory.class).shutDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageService> messageService() {
|
||||
return TomP2PMessageService.class;
|
||||
|
@ -152,8 +152,6 @@ public class TomP2PNode implements ClientNode {
|
||||
}
|
||||
|
||||
public void shutDown() {
|
||||
bootstrappedPeerFactory.shutDown();
|
||||
|
||||
if (peerDHT != null)
|
||||
peerDHT.shutdown();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user