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:
Manfred Karrer 2014-11-18 23:44:41 +01:00
parent 9517c7ee6d
commit b85317c8f3
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -152,8 +152,6 @@ public class TomP2PNode implements ClientNode {
}
public void shutDown() {
bootstrappedPeerFactory.shutDown();
if (peerDHT != null)
peerDHT.shutdown();
}