aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-12-27 10:11:21 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-27 10:17:11 -0800
commit7aa700424cbda387536373d8dfec88aee43f950e (patch)
tree866140c4737995ac77ac7ccefcb78f8b3cc2e353 /src/test/DoS_tests.cpp
parentdbc8a8c86ae50059fddb2d6834fa5f0c9bbf9b71 (diff)
parentc2f61bebb190258753714b29ab2041e80651cec9 (diff)
Merge #9243: Clean up mapArgs and mapMultiArgs Usage
c2f61be Add a ForceSetArg method for testing (Matt Corallo) 4e04814 Lock mapArgs/mapMultiArgs access in util (Matt Corallo) 4cd373a Un-expose mapArgs from utils.h (Matt Corallo) 71fde55 Get rid of mapArgs direct access in ZMQ construction (Matt Corallo) 0cf86a6 Introduce (and use) an IsArgSet accessor method (Matt Corallo) 2b5f085 Fix non-const mapMultiArgs[] access after init. (Matt Corallo) c8042a4 Remove arguments to ParseConfigFile (Matt Corallo)
Diffstat (limited to 'src/test/DoS_tests.cpp')
-rw-r--r--src/test/DoS_tests.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp
index 131d667e0b..d90dcaeb02 100644
--- a/src/test/DoS_tests.cpp
+++ b/src/test/DoS_tests.cpp
@@ -12,6 +12,7 @@
#include "script/sign.h"
#include "serialize.h"
#include "util.h"
+#include "validation.h"
#include "test/test_bitcoin.h"
@@ -74,7 +75,7 @@ BOOST_AUTO_TEST_CASE(DoS_banning)
BOOST_AUTO_TEST_CASE(DoS_banscore)
{
connman->ClearBanned();
- mapArgs["-banscore"] = "111"; // because 11 is my favorite number
+ ForceSetArg("-banscore", "111"); // because 11 is my favorite number
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 3, 1, "", true);
dummyNode1.SetSendVersion(PROTOCOL_VERSION);
@@ -89,7 +90,7 @@ BOOST_AUTO_TEST_CASE(DoS_banscore)
Misbehaving(dummyNode1.GetId(), 1);
SendMessages(&dummyNode1, *connman);
BOOST_CHECK(connman->IsBanned(addr1));
- mapArgs.erase("-banscore");
+ ForceSetArg("-banscore", std::to_string(DEFAULT_BANSCORE_THRESHOLD));
}
BOOST_AUTO_TEST_CASE(DoS_bantime)