From 5364edf9a36bf273e8833e1c186b3d47cdef5b58 Mon Sep 17 00:00:00 2001 From: romanman Date: Sat, 25 Oct 2014 09:57:41 -0500 Subject: [PATCH] active peer bug fix --- .../src/main/java/org/ethereum/facade/EthereumImpl.java | 4 +++- .../src/main/java/org/ethereum/net/client/PeerClient.java | 1 - ethereumj-studio/pom.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java b/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java index 9bfc0a78..59e18688 100644 --- a/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java +++ b/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java @@ -113,7 +113,9 @@ public class EthereumImpl implements Ethereum { @Override public void connect(String ip, int port) { logger.info("Connecting to: {}:{}", ip, port); - new PeerClient().connect(ip, port); + PeerClient peerClient = new PeerClient(); + WorldManager.getInstance().setActivePeer(peerClient); + peerClient.connect(ip, port); } @Override 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 b9447845..90dcf3cb 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 @@ -100,7 +100,6 @@ public class PeerClient { // Start the client. ChannelFuture f = b.connect().sync(); - WorldManager.getInstance().setActivePeer(this); // Wait until the connection is closed. f.channel().closeFuture().sync(); diff --git a/ethereumj-studio/pom.xml b/ethereumj-studio/pom.xml index fcd6c0e0..e73d3b0c 100644 --- a/ethereumj-studio/pom.xml +++ b/ethereumj-studio/pom.xml @@ -71,7 +71,7 @@ org.ethereum ethereumj - 0.7.2.20141025.0030 + 0.7.2.20141025.0948