Peer discovery work sequentially
1) Next step will be redesign for ThreadWorkers 2) Fixed for the new genesis hash
This commit is contained in:
parent
a16728d6a2
commit
6dabaad525
|
@ -71,14 +71,14 @@ public class ConnectionConsoleWindow extends JFrame implements PeerListener{
|
|||
|
||||
// new ClientPeer(thisConsole).connect("54.201.28.117", 30303); // peer discovery
|
||||
// new ClientPeer(thisConsole).connect("82.217.72.169", 30303); // Nick
|
||||
new ClientPeer(thisConsole).connect("82.217.72.169", 30303); // Nick
|
||||
// new ClientPeer(thisConsole).connect("82.217.72.169", 30303); // Nick
|
||||
|
||||
|
||||
// new ClientPeer(thisConsole).connect("54.204.10.41", 30303);
|
||||
// new ClientPeer(thisConsole).connect("54.211.14.10", 30303);
|
||||
|
||||
// new ClientPeer(thisConsole).connect("54.204.10.41", 30303); // CPP: ZeroGox Poc5
|
||||
// new ClientPeer(thisConsole).connect("54.211.14.10", 30303); // CPP: ver16
|
||||
new ClientPeer(thisConsole).connect("54.211.14.10", 30303); // CPP: ver16
|
||||
|
||||
// new ClientPeer(thisConsole).connect("192.168.1.102", 30303);
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class MainData {
|
|||
public byte[] getLatestBlockHash(){
|
||||
|
||||
if (blockChainDB.isEmpty())
|
||||
return (new Genesis()).getHash();
|
||||
return StaticMessages.GENESIS_HASH;
|
||||
else
|
||||
return blockChainDB.get(blockChainDB.size() - 1).getHash();
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class PeerTaster {
|
|||
|
||||
|
||||
// Start the client.
|
||||
// b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 15);
|
||||
b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 3000);
|
||||
ChannelFuture f = b.connect(host, port).sync(); // (5)
|
||||
|
||||
// Wait until the connection is closed.
|
||||
|
@ -90,6 +90,13 @@ public class PeerTaster {
|
|||
try {peerTaster.connect("54.2.10.41", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("0.204.10.41", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("54.204.10.41", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("54.211.14.10", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("82.217.72.169", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("54.201.28.117", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("54.2.10.41", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("0.204.10.41", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
try {peerTaster.connect("54.204.10.41", 30303);} catch (Exception e) {e.printStackTrace();}
|
||||
|
||||
|
||||
System.out.println("End of the roaad");
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class StaticMessages {
|
|||
|
||||
public static final byte[] DISCONNECT_00 = Hex.decode("2240089100000003C20100");
|
||||
public static final byte[] GET_CHAIN = Hex.decode("2240089100000027F82514A069A7356A245F9DC5B865475ADA5EE4E89B18F93C06503A9DB3B3630E88E9FB4E820100");
|
||||
public static final byte[] GENESIS_HASH = Hex.decode("c305511e7cb9b33767e50f5e94ecd7b1c51359a04f45183860ec6808d80b0d3f");
|
||||
public static final byte[] GENESIS_HASH = Hex.decode("f5232afe32aba6b366f8aa86a6939437c5e13d1fd71a0f51e77735d3456eb1a6");
|
||||
public static final byte[] MAGIC_PACKET = Hex.decode("22400891");
|
||||
|
||||
static {
|
||||
|
|
Loading…
Reference in New Issue