aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-12-21 22:33:19 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2011-12-21 22:33:19 +0100
commitbde280b9a4da2652716c8ffdeed9ebfa4461cc70 (patch)
treef2d96b0c74da35b701513a629817c7e944798827 /src/test/DoS_tests.cpp
parent21d9f36781604e4ca9fc35dc65265593423b73e9 (diff)
Revert "Use standard C99 (and Qt) types for 64-bit integers"
This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.
Diffstat (limited to 'src/test/DoS_tests.cpp')
-rw-r--r--src/test/DoS_tests.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp
index bea671c311..e9b7b4517a 100644
--- a/src/test/DoS_tests.cpp
+++ b/src/test/DoS_tests.cpp
@@ -1,8 +1,6 @@
//
// Unit tests for denial-of-service detection/prevention code
//
-#include <stdint.h>
-
#include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/test/unit_test.hpp>
#include <boost/foreach.hpp>
@@ -52,7 +50,7 @@ BOOST_AUTO_TEST_CASE(DoS_banscore)
BOOST_AUTO_TEST_CASE(DoS_bantime)
{
CNode::ClearBanned();
- int64_t nStartTime = GetTime();
+ int64 nStartTime = GetTime();
SetMockTime(nStartTime); // Overrides future calls to GetTime()
CAddress addr(0xa0b0c001);
@@ -68,11 +66,11 @@ BOOST_AUTO_TEST_CASE(DoS_bantime)
BOOST_CHECK(!CNode::IsBanned(addr.ip));
}
-static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2, int64_t time2)
+static bool CheckNBits(unsigned int nbits1, int64 time1, unsigned int nbits2, int64 time2)
{
if (time1 > time2)
return CheckNBits(nbits2, time2, nbits1, time1);
- int64_t deltaTime = time2-time1;
+ int64 deltaTime = time2-time1;
CBigNum required;
required.SetCompact(ComputeMinWork(nbits1, deltaTime));
@@ -87,7 +85,7 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits)
// Timestamps,nBits from the bitcoin blockchain.
// These are the block-chain checkpoint blocks
- typedef std::map<int64_t, unsigned int> BlockData;
+ typedef std::map<int64, unsigned int> BlockData;
BlockData chainData =
map_list_of(1239852051,486604799)(1262749024,486594666)
(1279305360,469854461)(1280200847,469830746)(1281678674,469809688)