diff --git a/ethereumj-core/bintray-publish-version.xml b/ethereumj-core/bintray-publish-version.xml index 10f0af02..e5865ff0 100644 --- a/ethereumj-core/bintray-publish-version.xml +++ b/ethereumj-core/bintray-publish-version.xml @@ -26,7 +26,7 @@ - + diff --git a/ethereumj-core/src/main/java/org/ethereum/net/client/PeerClient.java b/ethereumj-core/src/main/java/org/ethereum/net/client/PeerClient.java index f3233672..2b987899 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/client/PeerClient.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/client/PeerClient.java @@ -6,6 +6,7 @@ import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.timeout.ReadTimeoutHandler; +import org.ethereum.manager.WorldManager; import org.ethereum.net.MessageQueue; import org.ethereum.net.PeerListener; import org.ethereum.net.eth.EthHandler; @@ -106,20 +107,14 @@ public class PeerClient { throw new Error("Disconnnected"); } finally { workerGroup.shutdownGracefully(); - p2pHandler.killTimers(); -/* - final Set peers = WorldManager.getInstance().getPeerDiscovery().getPeers(); + if (!peerDiscoveryMode){ + if (WorldManager.getInstance().getListener() != null) + WorldManager.getInstance().getListener(). + onPeerDisconnect(host, port); + } - synchronized (peers) { - for (PeerData peer : peers) { - if (host.equals(peer.getAddress().getHostAddress()) - && port == peer.getPort()) - peer.setOnline(false); - } - } -*/ } } diff --git a/ethereumj-core/src/main/java/org/ethereum/net/message/StaticMessages.java b/ethereumj-core/src/main/java/org/ethereum/net/message/StaticMessages.java index a92a2e99..008371e2 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/message/StaticMessages.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/message/StaticMessages.java @@ -41,7 +41,7 @@ public class StaticMessages { List capabilities = Arrays.asList( new Capability(Capability.ETH, EthHandler.VERSION), new Capability(Capability.SHH, ShhHandler.VERSION)); - int listenPort = 30303; + int listenPort = 333; return new HelloMessage(p2pVersion, helloAnnouncement, capabilities, listenPort, PEER_ID); diff --git a/ethereumj-core/src/main/java/org/ethereum/net/p2p/DisconnectMessage.java b/ethereumj-core/src/main/java/org/ethereum/net/p2p/DisconnectMessage.java index 3170dade..7c92c250 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/p2p/DisconnectMessage.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/p2p/DisconnectMessage.java @@ -51,6 +51,11 @@ public class DisconnectMessage extends P2pMessage { return encoded; } + @Override + public P2pMessageCodes getCommand(){ + return P2pMessageCodes.DISCONNECT; + } + @Override public Class getAnswerMessage() { return null;