From eb047148fffe46d4d3561e36dd67d4a71095c886 Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 22 Mar 2015 19:05:39 +0100 Subject: [PATCH] fix net/ unit tests for nodetable updates --- net.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net.cpp b/net.cpp index e5cca9b66..23ad0fb4a 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 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; }