mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
test: Same addr, diff port is already connected
This commit is contained in:
parent
94e85a82a7
commit
f1b142856a
1 changed files with 7 additions and 0 deletions
|
@ -155,6 +155,13 @@ BOOST_FIXTURE_TEST_CASE(test_addnode_getaddednodeinfo_and_connection_detection,
|
||||||
BOOST_CHECK(connman->AlreadyConnectedPublic(node->addr));
|
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
|
// Clean up
|
||||||
for (auto node : connman->TestNodes()) {
|
for (auto node : connman->TestNodes()) {
|
||||||
peerman->FinalizeNode(*node);
|
peerman->FinalizeNode(*node);
|
||||||
|
|
Loading…
Add table
Reference in a new issue