mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 23:42:33 +02:00
test: fix off-by-one logic in an eviction protection test
This commit is contained in:
parent
f7b8094d61
commit
0c00c0c981
@ -289,16 +289,16 @@ BOOST_AUTO_TEST_CASE(peer_protection_test)
|
|||||||
BOOST_CHECK(IsProtected(
|
BOOST_CHECK(IsProtected(
|
||||||
4, [](NodeEvictionCandidate& c) {
|
4, [](NodeEvictionCandidate& c) {
|
||||||
c.m_connected = std::chrono::seconds{c.id};
|
c.m_connected = std::chrono::seconds{c.id};
|
||||||
c.m_is_local = (c.id == 3);
|
c.m_is_local = (c.id == 2);
|
||||||
if (c.id == 4) {
|
if (c.id == 3) {
|
||||||
c.m_network = NET_I2P;
|
c.m_network = NET_I2P;
|
||||||
} else if (c.id == 2) {
|
} else if (c.id == 1) {
|
||||||
c.m_network = NET_ONION;
|
c.m_network = NET_ONION;
|
||||||
} else {
|
} else {
|
||||||
c.m_network = NET_IPV6;
|
c.m_network = NET_IPV6;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/*protected_peer_ids=*/{0, 4},
|
/*protected_peer_ids=*/{0, 3},
|
||||||
/*unprotected_peer_ids=*/{1, 2},
|
/*unprotected_peer_ids=*/{1, 2},
|
||||||
random_context));
|
random_context));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user