@@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(connections_desirable_service_flags)
3636
3737 // Check we start connecting to full nodes
3838 ServiceFlags peer_flags{NODE_WITNESS | NODE_NETWORK_LIMITED};
39- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS));
39+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS | NODE_BIP444 ));
4040
4141 // Make peerman aware of the initial best block and verify we accept limited peers when we start close to the tip time.
4242 auto tip = WITH_LOCK (::cs_main, return m_node.chainman ->ActiveChain ().Tip ());
@@ -45,15 +45,15 @@ BOOST_AUTO_TEST_CASE(connections_desirable_service_flags)
4545 peerman->SetBestBlock (tip_block_height, std::chrono::seconds{tip_block_time});
4646
4747 SetMockTime (tip_block_time + 1 ); // Set node time to tip time
48- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK_LIMITED | NODE_WITNESS));
48+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK_LIMITED | NODE_WITNESS | NODE_BIP444 ));
4949
5050 // Check we don't disallow limited peers connections when we are behind but still recoverable (below the connection safety window)
5151 SetMockTime (GetTime<std::chrono::seconds>() + std::chrono::seconds{consensus.nPowTargetSpacing * (NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS - 1 )});
52- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK_LIMITED | NODE_WITNESS));
52+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK_LIMITED | NODE_WITNESS | NODE_BIP444 ));
5353
5454 // Check we disallow limited peers connections when we are further than the limited peers safety window
5555 SetMockTime (GetTime<std::chrono::seconds>() + std::chrono::seconds{consensus.nPowTargetSpacing * 2 });
56- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS));
56+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS | NODE_BIP444 ));
5757
5858 // By now, we tested that the connections desirable services flags change based on the node's time proximity to the tip.
5959 // Now, perform the same tests for when the node receives a block.
@@ -62,15 +62,15 @@ BOOST_AUTO_TEST_CASE(connections_desirable_service_flags)
6262 // First, verify a block in the past doesn't enable limited peers connections
6363 // At this point, our time is (NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS + 1) * 10 minutes ahead the tip's time.
6464 mineBlock (m_node, /* block_time=*/ std::chrono::seconds{tip_block_time + 1 });
65- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS));
65+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS | NODE_BIP444 ));
6666
6767 // Verify a block close to the tip enables limited peers connections
6868 mineBlock (m_node, /* block_time=*/ GetTime<std::chrono::seconds>());
69- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK_LIMITED | NODE_WITNESS));
69+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK_LIMITED | NODE_WITNESS | NODE_BIP444 ));
7070
7171 // Lastly, verify the stale tip checks can disallow limited peers connections after not receiving blocks for a prolonged period.
7272 SetMockTime (GetTime<std::chrono::seconds>() + std::chrono::seconds{consensus.nPowTargetSpacing * NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS + 1 });
73- BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS));
73+ BOOST_CHECK (peerman->GetDesirableServiceFlags (peer_flags) == ServiceFlags (NODE_NETWORK | NODE_WITNESS | NODE_BIP444 ));
7474}
7575
7676BOOST_AUTO_TEST_SUITE_END ()
0 commit comments