mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 06:49:38 -04:00
Compare commits
5 commits
09ce1179f5
...
810ec2ddd4
Author | SHA1 | Date | |
---|---|---|---|
|
810ec2ddd4 | ||
|
c5e44a0435 | ||
|
32d55e28af | ||
|
f1b142856a | ||
|
94e85a82a7 |
4 changed files with 14 additions and 3 deletions
|
@ -367,7 +367,7 @@ CNode* CConnman::FindNode(const CService& addr)
|
|||
|
||||
bool CConnman::AlreadyConnectedToAddress(const CAddress& addr)
|
||||
{
|
||||
return FindNode(static_cast<CNetAddr>(addr)) || FindNode(addr.ToStringAddrPort());
|
||||
return FindNode(static_cast<CNetAddr>(addr));
|
||||
}
|
||||
|
||||
bool CConnman::CheckIncomingNonce(uint64_t nonce)
|
||||
|
|
|
@ -101,10 +101,14 @@ FUZZ_TARGET(netaddress)
|
|||
(void)net_addr.GetReachabilityFrom(other_net_addr);
|
||||
(void)sub_net.Match(other_net_addr);
|
||||
|
||||
const CService other_service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
|
||||
const CService other_service{fuzzed_data_provider.ConsumeBool() ? net_addr : other_net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
|
||||
assert((service == other_service) != (service != other_service));
|
||||
(void)(service < other_service);
|
||||
|
||||
if (service.ToStringAddrPort() == other_service.ToStringAddrPort()) {
|
||||
assert(static_cast<CNetAddr>(service) == static_cast<CNetAddr>(other_service));
|
||||
}
|
||||
|
||||
const CSubNet sub_net_copy_1{net_addr, other_net_addr};
|
||||
const CSubNet sub_net_copy_2{net_addr};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -87,7 +87,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||
# 0.21.x and 22.x would both produce bad derivation paths when topping up an inactive hd chain
|
||||
# Make sure that this is being automatically cleaned up by migration
|
||||
node_master = self.nodes[1]
|
||||
node_v22 = self.nodes[self.num_nodes - 5]
|
||||
node_v22 = self.nodes[self.num_nodes - 3]
|
||||
wallet_name = "bad_deriv_path"
|
||||
node_v22.createwallet(wallet_name=wallet_name, descriptors=False)
|
||||
bad_deriv_wallet = node_v22.get_wallet_rpc(wallet_name)
|
||||
|
|
Loading…
Add table
Reference in a new issue