Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2019 The Bitcoin Core developers | // Copyright (c) 2009-2019 The Bitcoin Core developers | ||||
// Copyright (c) 2017-2020 The Bitcoin developers | // Copyright (c) 2017-2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_VALIDATION_H | #ifndef BITCOIN_VALIDATION_H | ||||
#define BITCOIN_VALIDATION_H | #define BITCOIN_VALIDATION_H | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include <config/bitcoin-config.h> | #include <config/bitcoin-config.h> | ||||
#endif | #endif | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <blockfileinfo.h> | #include <blockfileinfo.h> | ||||
#include <blockindexworkcomparator.h> | #include <blockindexworkcomparator.h> | ||||
#include <chainparams.h> | |||||
#include <coins.h> | #include <coins.h> | ||||
#include <consensus/consensus.h> | #include <consensus/consensus.h> | ||||
#include <disconnectresult.h> | #include <disconnectresult.h> | ||||
#include <flatfile.h> | #include <flatfile.h> | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <protocol.h> // For CMessageHeader::MessageMagic | #include <protocol.h> // For CMessageHeader::MessageMagic | ||||
#include <script/script_error.h> | #include <script/script_error.h> | ||||
#include <script/script_metrics.h> | #include <script/script_metrics.h> | ||||
▲ Show 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* Returns true if the provided block is valid (has valid header, | * Returns true if the provided block is valid (has valid header, | ||||
* transactions are valid, block is a valid size, etc.) | * transactions are valid, block is a valid size, etc.) | ||||
*/ | */ | ||||
bool CheckBlock(const CBlock &block, BlockValidationState &state, | bool CheckBlock(const CBlock &block, BlockValidationState &state, | ||||
const Consensus::Params ¶ms, | const Consensus::Params ¶ms, | ||||
BlockValidationOptions validationOptions); | BlockValidationOptions validationOptions); | ||||
namespace Checkpoints { | |||||
bool CheckBlock(const CCheckpointData &data, int nHeight, | |||||
const BlockHash &hash); | |||||
CBlockIndex *GetLastCheckpoint(const CCheckpointData &data) | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | |||||
} // namespace Checkpoints | |||||
/** | /** | ||||
* This is a variant of ContextualCheckTransaction which computes the contextual | * This is a variant of ContextualCheckTransaction which computes the contextual | ||||
* check for a transaction based on the chain tip. | * check for a transaction based on the chain tip. | ||||
* | * | ||||
* See consensus/consensus.h for flag definitions. | * See consensus/consensus.h for flag definitions. | ||||
*/ | */ | ||||
bool ContextualCheckTransactionForCurrentBlock(const Consensus::Params ¶ms, | bool ContextualCheckTransactionForCurrentBlock(const Consensus::Params ¶ms, | ||||
const CTransaction &tx, | const CTransaction &tx, | ||||
▲ Show 20 Lines • Show All 391 Lines • Show Last 20 Lines |