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-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2017 The Bitcoin developers | // Copyright (c) 2017 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 "chain.h" | |||||
jasonbcox: Adding this for BlockMap typedef, which was moved to chain.h in D712 | |||||
deadalnixUnsubmitted Not Done Inline ActionsThat was the second sign. deadalnix: That was the second sign. | |||||
#include "coins.h" | #include "coins.h" | ||||
#include "consensus/consensus.h" | #include "consensus/consensus.h" | ||||
#include "consensus/params.h" | #include "consensus/params.h" | ||||
#include "diskblockpos.h" | #include "diskblockpos.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 "sync.h" | #include "sync.h" | ||||
▲ Show 20 Lines • Show All 589 Lines • ▼ Show 20 Lines | public: | ||||
~CVerifyDB(); | ~CVerifyDB(); | ||||
bool VerifyDB(const Config &config, CCoinsView *coinsview, int nCheckLevel, | bool VerifyDB(const Config &config, CCoinsView *coinsview, int nCheckLevel, | ||||
int nCheckDepth); | int nCheckDepth); | ||||
}; | }; | ||||
/** Replay blocks that aren't fully applied to the database. */ | /** Replay blocks that aren't fully applied to the database. */ | ||||
bool ReplayBlocks(const Config &config, CCoinsView *view); | bool ReplayBlocks(const Config &config, CCoinsView *view); | ||||
inline CBlockIndex *LookupBlockIndex(const uint256 &hash) { | |||||
AssertLockHeld(cs_main); | |||||
BlockMap::const_iterator it = mapBlockIndex.find(hash); | |||||
return it == mapBlockIndex.end() ? nullptr : it->second; | |||||
} | |||||
deadalnixUnsubmitted Not Done Inline ActionsThis very clearly belongs into chain.h deadalnix: This very clearly belongs into chain.h | |||||
/** Find the last common block between the parameter chain and a locator. */ | /** Find the last common block between the parameter chain and a locator. */ | ||||
CBlockIndex *FindForkInGlobalIndex(const CChain &chain, | CBlockIndex *FindForkInGlobalIndex(const CChain &chain, | ||||
const CBlockLocator &locator); | const CBlockLocator &locator); | ||||
/** | /** | ||||
* Treats a block as if it were received before others with the same work, | * Treats a block as if it were received before others with the same work, | ||||
* making it the active chain tip if applicable. Successive calls to | * making it the active chain tip if applicable. Successive calls to | ||||
* PreciousBlock() will override the effects of earlier calls. The effects of | * PreciousBlock() will override the effects of earlier calls. The effects of | ||||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |
Adding this for BlockMap typedef, which was moved to chain.h in D712