aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2015-03-23 02:05:39 +0800
committersubtly <subtly@users.noreply.github.com>2015-03-23 02:05:39 +0800
commiteb047148fffe46d4d3561e36dd67d4a71095c886 (patch)
treef8a6f256d3032d2f5ef2ed2a7bb733cfb2410434
parent3d98932c1ee505fd937e9a56941b5a3d25cd65eb (diff)
downloaddexon-solidity-eb047148fffe46d4d3561e36dd67d4a71095c886.tar.gz
dexon-solidity-eb047148fffe46d4d3561e36dd67d4a71095c886.tar.zst
dexon-solidity-eb047148fffe46d4d3561e36dd67d4a71095c886.zip
fix net/ unit tests for nodetable updates
-rw-r--r--net.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/net.cpp b/net.cpp
index e5cca9b6..23ad0fb4 100644
--- a/net.cpp
+++ b/net.cpp
@@ -89,7 +89,16 @@ struct TestNodeTable: public NodeTable
bi::address ourIp = bi::address::from_string("127.0.0.1");
for (auto& n: _testNodes)
if (_count--)
+ {
+ // manually add node for test
+ {
+ Guard ln(x_nodes);
+ shared_ptr<NodeEntry> node(new NodeEntry(m_node, n.first.pub(), NodeIPEndpoint(bi::udp::endpoint(ourIp, n.second), bi::tcp::endpoint(ourIp, n.second))));
+ node->pending = false;
+ m_nodes[node->id] = node;
+ }
noteActiveNode(n.first.pub(), bi::udp::endpoint(ourIp, n.second));
+ }
else
break;
}