Changeset View
Changeset View
Standalone View
Standalone View
src/test/denialofservice_tests.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction) { | ||||
peerLogic->InitializeNode(config, &dummyNode1); | peerLogic->InitializeNode(config, &dummyNode1); | ||||
dummyNode1.nVersion = 1; | dummyNode1.nVersion = 1; | ||||
dummyNode1.fSuccessfullyConnected = true; | dummyNode1.fSuccessfullyConnected = true; | ||||
// This test requires that we have a chain with non-zero work. | // This test requires that we have a chain with non-zero work. | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
BOOST_CHECK(chainActive.Tip() != nullptr); | BOOST_CHECK(::ChainActive().Tip() != nullptr); | ||||
BOOST_CHECK(chainActive.Tip()->nChainWork > 0); | BOOST_CHECK(::ChainActive().Tip()->nChainWork > 0); | ||||
} | } | ||||
// Test starts here | // Test starts here | ||||
{ | { | ||||
LOCK2(cs_main, dummyNode1.cs_sendProcessing); | LOCK2(cs_main, dummyNode1.cs_sendProcessing); | ||||
// should result in getheaders | // should result in getheaders | ||||
peerLogic->SendMessages(config, &dummyNode1, interruptDummy); | peerLogic->SendMessages(config, &dummyNode1, interruptDummy); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 376 Lines • Show Last 20 Lines |