v31.1-roots.1 · Commit 5: [PATCH 05/17] feat(net): preserve Roots peer controls and health view on v31
src/test/denialofservice_tests.cpp
Before: src/test/denialofservice_tests.cpp · After: src/test/denialofservice_tests.cpp
File metadata
index 776a18788e3298954427a06ab07fb54c6d342136..78e0389f553b6626511559707434e8343adab2c8 100644
Download original patch · Release notes
Diff rows 1–13 of 13. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/test/denialofservice_tests.cpp
CHANGED
|
@@ -335,7 +335,13 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
|
|
|
335
335
|
peerLogic->InitializeNode(*nodes[0], NODE_NETWORK);
|
|
336
336
|
nodes[0]->fSuccessfullyConnected = true;
|
|
337
337
|
connman->AddTestNode(*nodes[0]);
|
|
338
|
+
CNodeStateStats stats;
|
|
339
|
+
BOOST_REQUIRE(peerLogic->GetNodeStateStats(nodes[0]->GetId(), stats));
|
|
340
|
+
BOOST_CHECK_EQUAL(stats.m_misbehavior_score, 0);
|
|
341
|
+
BOOST_CHECK_EQUAL(stats.m_last_block_announcement.count(), 0);
|
|
338
342
|
peerLogic->UnitTestMisbehaving(nodes[0]->GetId()); // Should be discouraged
|
|
343
|
+
BOOST_REQUIRE(peerLogic->GetNodeStateStats(nodes[0]->GetId(), stats));
|
|
344
|
+
BOOST_CHECK_EQUAL(stats.m_misbehavior_score, 100);
|
|
339
345
|
BOOST_CHECK(peerLogic->SendMessages(*nodes[0]));
|
|
340
346
|
|
|
341
347
|
BOOST_CHECK(banman->IsDiscouraged(addr[0]));
|