diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-08-25 09:58:23 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-08-25 10:48:24 +0200 |
| commit | 026c6edac947eccb6d6e544468080af9c53593a8 (patch) | |
| tree | af2bb9333660b51482f71a0055d8a4e45b82f56a /src/test/net_tests.cpp | |
| parent | Merge #8463: [qt] Remove Priority from coincontrol dialog (diff) | |
| parent | Added feeler connections increasing good addrs in the tried table. (diff) | |
| download | discoin-026c6edac947eccb6d6e544468080af9c53593a8.tar.xz discoin-026c6edac947eccb6d6e544468080af9c53593a8.zip | |
Merge #8282: net: Feeler connections to increase online addrs in the tried table.
dbb1f64 Added feeler connections increasing good addrs in the tried table. (Ethan Heilman)
Diffstat (limited to 'src/test/net_tests.cpp')
| -rw-r--r-- | src/test/net_tests.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 6511e6ffa..267d1b55e 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -150,4 +150,26 @@ BOOST_AUTO_TEST_CASE(caddrdb_read_corrupted) BOOST_CHECK(addrman2.size() == 0); } +BOOST_AUTO_TEST_CASE(cnode_simple_test) +{ + SOCKET hSocket = INVALID_SOCKET; + + in_addr ipv4Addr; + ipv4Addr.s_addr = 0xa0b0c001; + + CAddress addr = CAddress(CService(ipv4Addr, 7777), NODE_NETWORK); + std::string pszDest = ""; + bool fInboundIn = false; + + // Test that fFeeler is false by default. + CNode* pnode1 = new CNode(hSocket, addr, pszDest, fInboundIn); + BOOST_CHECK(pnode1->fInbound == false); + BOOST_CHECK(pnode1->fFeeler == false); + + fInboundIn = true; + CNode* pnode2 = new CNode(hSocket, addr, pszDest, fInboundIn); + BOOST_CHECK(pnode2->fInbound == true); + BOOST_CHECK(pnode2->fFeeler == false); +} + BOOST_AUTO_TEST_SUITE_END() |