mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-04 11:14:16 +00:00
dce8360e44
Instead of only checking height to decide whether to disable script checks, actually check whether a block is an ancestor of a checkpoint, up to which headers have been validated. This means that we don't have to prevent accepting a side branch anymore - it will be safe, just less fast to do. We still need to prevent being fed a multitude of low-difficulty headers filling up our memory. The mechanism for that is unchanged for now: once a checkpoint is reached with headers, no headers chain branching off before that point are allowed anymore.
28 lines
710 B
C++
28 lines
710 B
C++
// Copyright (c) 2011-2013 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
//
|
|
// Unit tests for block-chain checkpoints
|
|
//
|
|
|
|
#include "checkpoints.h"
|
|
|
|
#include "uint256.h"
|
|
#include "test/test_bitcoin.h"
|
|
#include "chainparams.h"
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
using namespace std;
|
|
|
|
BOOST_FIXTURE_TEST_SUITE(Checkpoints_tests, BasicTestingSetup)
|
|
|
|
BOOST_AUTO_TEST_CASE(sanity)
|
|
{
|
|
const Checkpoints::CCheckpointData& checkpoints = Params(CBaseChainParams::MAIN).Checkpoints();
|
|
BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate(checkpoints) >= 134444);
|
|
}
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|