Skip to content

Commit

Permalink
test: add GetAddedNodeInfo() CJDNS regression unit test
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#30085
Rebased-From: d0b0474
  • Loading branch information
jonatack authored and luke-jr committed May 15, 2024
1 parent 4421251 commit ac5c317
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/net_peer_connection_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ BOOST_AUTO_TEST_CASE(test_addnode_getaddednodeinfo_and_connection_detection)
AddPeer(id, nodes, *peerman, *connman, ConnectionType::BLOCK_RELAY, /*onion_peer=*/true);
AddPeer(id, nodes, *peerman, *connman, ConnectionType::INBOUND);

// Add a CJDNS peer connection.
AddPeer(id, nodes, *peerman, *connman, ConnectionType::INBOUND, /*onion_peer=*/false,
/*address=*/"[fc00:3344:5566:7788:9900:aabb:ccdd:eeff]:1234");
BOOST_CHECK(nodes.back()->IsInboundConn());
BOOST_CHECK_EQUAL(nodes.back()->ConnectedThroughNetwork(), Network::NET_CJDNS);

BOOST_TEST_MESSAGE("Call AddNode() for all the peers");
for (auto node : connman->TestNodes()) {
BOOST_CHECK(connman->AddNode({/*m_added_node=*/node->addr.ToStringAddrPort(), /*m_use_v2transport=*/true}));
Expand Down

0 comments on commit ac5c317

Please sign in to comment.