test: Same addr, diff port is already connected

This commit is contained in:
David Gumberg authored and Vasil Dimov committed 2025-04-25 15:20:34 +02:00
1 parent 94e85a82a7
commit f1b142856a
1 file changed
+7
+7
View File
@@ -155,6 +155,13 @@ BOOST_FIXTURE_TEST_CASE(test_addnode_getaddednodeinfo_and_connection_detection,
BOOST_CHECK(connman->AlreadyConnectedPublic(node->addr));
}
BOOST_TEST_MESSAGE("\nCheck that peers with the same addresses as connected peers but different ports are detected as connected.");
for (auto node : connman->TestNodes()) {
uint16_t changed_port = node->addr.GetPort() + 1;
CService address_with_changed_port{node->addr, changed_port};
BOOST_CHECK(connman->AlreadyConnectedPublic(CAddress{address_with_changed_port, NODE_NONE}));
}
// Clean up
for (auto node : connman->TestNodes()) {
peerman->FinalizeNode(*node);