mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Merge bitcoin/bitcoin#27745: addrman: select addresses by network follow-up
cd8ef5b3e6test: ensure addrman test is finite (Amiti Uttarwar)b9f1e86f12addrman: change asserts to Assumes (Amiti Uttarwar)768770771fdoc: update `Select` function description (Amiti Uttarwar)2b6bd12eearefactor: de-duplicate lookups (Amiti Uttarwar) Pull request description: this PR addresses outstanding review comments from #27214 ACKs for top commit: achow101: ACKcd8ef5b3e6mzumsande: Code Review ACKcd8ef5b3e6brunoerg: crACKcd8ef5b3e6Tree-SHA512: 669f67904263e3f51c39b175eabf5fa1b1e7b6841e889656afec33d0bd93fb446de9403f0a91b186ddeaf29498c8938484a0547b1188256c4e7c90db6f30bb55
This commit is contained in:
@@ -239,8 +239,9 @@ BOOST_AUTO_TEST_CASE(addrman_select_by_network)
|
||||
// ensure that both new and tried table are selected from
|
||||
bool new_selected{false};
|
||||
bool tried_selected{false};
|
||||
int counter = 256;
|
||||
|
||||
while (!new_selected || !tried_selected) {
|
||||
while (--counter > 0 && (!new_selected || !tried_selected)) {
|
||||
const CAddress selected{addrman->Select(/*new_only=*/false, NET_I2P).first};
|
||||
BOOST_REQUIRE(selected == i2p_addr || selected == i2p_addr2);
|
||||
if (selected == i2p_addr) {
|
||||
@@ -249,6 +250,9 @@ BOOST_AUTO_TEST_CASE(addrman_select_by_network)
|
||||
new_selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_CHECK(new_selected);
|
||||
BOOST_CHECK(tried_selected);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_select_special)
|
||||
|
||||
Reference in New Issue
Block a user