aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2015-01-11 02:45:20 +0800
committersubtly <subtly@users.noreply.github.com>2015-01-11 02:45:20 +0800
commita1c972075eeca086dd7f95b9dfe72737d00457b0 (patch)
tree3006d48389dc72c640c8f4d4647d8d5c18dc2dba
parent64181322630df833398ce3f6ca57f93a426f40e1 (diff)
downloaddexon-solidity-a1c972075eeca086dd7f95b9dfe72737d00457b0.tar.gz
dexon-solidity-a1c972075eeca086dd7f95b9dfe72737d00457b0.tar.zst
dexon-solidity-a1c972075eeca086dd7f95b9dfe72737d00457b0.zip
Merging in new data structure for nodes from node-table. End result will be consolidation into NodeId, Node (id and endpoints), NodeEntry (as in table), and Peer (connected node as in host). Rename PeerInfo to PeerSessionInfo. Rename NodeInfo to PeerInfo. PeerSessionInfo which is information about the Peer connection and will be split/merged into Node and PeerInfo. Add node-table callbacks for Host to perform connect node if there are not enough nodes.
-rw-r--r--peer.cpp16
-rw-r--r--whisperTopic.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/peer.cpp b/peer.cpp
index d13ea97f..5c11d4cf 100644
--- a/peer.cpp
+++ b/peer.cpp
@@ -49,14 +49,14 @@ int peerTest(int argc, char** argv)
Host ph("Test", NetworkPreferences(listenPort));
if (!remoteHost.empty())
- ph.connect(NodeId(), remoteHost, remotePort);
-
- for (int i = 0; ; ++i)
- {
- this_thread::sleep_for(chrono::milliseconds(100));
- if (!(i % 10))
- ph.keepAlivePeers();
- }
+ ph.addNode(NodeId(), remoteHost, remotePort, remotePort);
+
+// for (int i = 0; ; ++i)
+// {
+// this_thread::sleep_for(chrono::milliseconds(100));
+// if (!(i % 10))
+// ph.keepAlivePeers();
+// }
return 0;
}
diff --git a/whisperTopic.cpp b/whisperTopic.cpp
index 8ecabde9..ea46b162 100644
--- a/whisperTopic.cpp
+++ b/whisperTopic.cpp
@@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(topic)
this_thread::sleep_for(chrono::milliseconds(500));
ph.start();
this_thread::sleep_for(chrono::milliseconds(500));
- ph.connect(NodeId(), "127.0.0.1", 50303);
+ ph.addNode(NodeId(), "127.0.0.1", 50303, 50303);
KeyPair us = KeyPair::create();
for (int i = 0; i < 10; ++i)