diff options
| author | Sam Garrett <[email protected]> | 2014-02-01 13:03:43 -0500 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2014-04-05 23:03:04 +0100 |
| commit | 36001b330d7382119782b85e1ec455e97a7598a3 (patch) | |
| tree | fd5f7748e1b666d96489d0356339d534e8f294b0 /src/test/DoS_tests.cpp | |
| parent | Merge pull request #411 from jwiechers/patch-3 (diff) | |
| download | discoin-36001b330d7382119782b85e1ec455e97a7598a3.tar.xz discoin-36001b330d7382119782b85e1ec455e97a7598a3.zip | |
test - fixed tests that were failing because of bit/litecoin cruft
Conflicts:
src/test/Checkpoints_tests.cpp
src/test/key_tests.cpp
Diffstat (limited to 'src/test/DoS_tests.cpp')
| -rw-r--r-- | src/test/DoS_tests.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index fbca09b4d..e3e29a6ea 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -114,14 +114,11 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits) { using namespace boost::assign; // for 'map_list_of()' - // Timestamps,nBits from the bitcoin block chain. + // Timestamps,and difficulty from the bitcoin blockchain. // These are the block-chain checkpoint blocks typedef std::map<int64_t, unsigned int> BlockData; BlockData chainData = - map_list_of(1239852051,486604799)(1262749024,486594666) - (1279305360,469854461)(1280200847,469830746)(1281678674,469809688) - (1296207707,453179945)(1302624061,453036989)(1309640330,437004818) - (1313172719,436789733); + map_list_of(1386481098,486789243)(1388890893,469814416); // Make sure CheckNBits considers every combination of block-chain-lock-in-points // "sane": @@ -140,7 +137,7 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits) // First checkpoint difficulty at or a while after the last checkpoint time should fail when // compared to last checkpoint BOOST_CHECK(!CheckNBits(firstcheck.second, lastcheck.first+60*10, lastcheck.second, lastcheck.first)); - BOOST_CHECK(!CheckNBits(firstcheck.second, lastcheck.first+60*60*24*14, lastcheck.second, lastcheck.first)); + BOOST_CHECK(!CheckNBits(firstcheck.second, lastcheck.first+60*60*24*4, lastcheck.second, lastcheck.first)); // ... but OK if enough time passed for difficulty to adjust downward: BOOST_CHECK(CheckNBits(firstcheck.second, lastcheck.first+60*60*24*365*4, lastcheck.second, lastcheck.first)); |