PIVX Core  5.6.99
P2P Digital Currency
Classes | Typedefs | Functions | Variables
validation.h File Reference
#include "amount.h"
#include "chain.h"
#include "coins.h"
#include "consensus/validation.h"
#include "fs.h"
#include "moneysupply.h"
#include "policy/feerate.h"
#include "script/script_error.h"
#include "sync.h"
#include "txmempool.h"
#include <algorithm>
#include <atomic>
#include <exception>
#include <map>
#include <memory>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for validation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BlockHasher
 
class  CScriptCheck
 Closure representing one script verification Note that this stores references to the spending transaction. More...
 
class  CVerifyDB
 RAII wrapper for VerifyDB: Verify consistency of the block and coin databases. More...
 

Typedefs

typedef std::unordered_map< uint256, CBlockIndex *, BlockHasherBlockMap
 
typedef std::unordered_multimap< uint256, CBlockIndex *, BlockHasherPrevBlockMap
 

Functions

bool ProcessNewBlock (const std::shared_ptr< const CBlock > &pblock, const FlatFilePos *dbp)
 Process an incoming block. More...
 
FILE * OpenBlockFile (const FlatFilePos &pos, bool fReadOnly=false)
 Open a block file (blk?????.dat) More...
 
FILE * OpenUndoFile (const FlatFilePos &pos, bool fReadOnly=false)
 Open an undo file (rev?????.dat) More...
 
fs::path GetBlockPosFilename (const FlatFilePos &pos)
 Translation to a filesystem path. More...
 
bool LoadExternalBlockFile (FILE *fileIn, FlatFilePos *dbp=nullptr)
 Import blocks from an external file. More...
 
bool LoadGenesisBlock ()
 Ensures we have a genesis block in the block tree, possibly writing one to disk. More...
 
bool LoadBlockIndex (std::string &strError) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Load the block tree and coins database from disk, initializing state if we're running with -reindex. More...
 
bool LoadChainTip (const CChainParams &chainparams) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Update the chain tip based on database information. More...
 
void UnloadBlockIndex ()
 Unload database information. More...
 
int ActiveProtocol ()
 See whether the protocol update is enforced for connected nodes. More...
 
void ThreadScriptCheck ()
 Run an instance of the script checking thread. More...
 
bool IsInitialBlockDownload ()
 Check whether we are doing an initial block download (synchronizing from disk or network) More...
 
bool GetTransaction (const uint256 &hash, CTransactionRef &tx, uint256 &hashBlock, bool fAllowSlow=false, CBlockIndex *blockIndex=nullptr)
 Retrieve a transaction (from memory pool, or from disk, if possible) More...
 
bool GetOutput (const uint256 &hash, unsigned int index, CValidationState &state, CTxOut &out)
 Retrieve an output (from memory pool, or from disk, if possible) More...
 
double ConvertBitsToDouble (unsigned int nBits)
 
int64_t GetMasternodePayment (int nHeight)
 
bool ActivateBestChain (CValidationState &state, std::shared_ptr< const CBlock > pblock=std::shared_ptr< const CBlock >())
 Find the best known block, and make it the tip of the block chain. More...
 
CAmount GetBlockValue (int nHeight)
 
CBlockIndexInsertBlockIndex (const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Create a new block index entry for a given block hash. More...
 
void FlushStateToDisk ()
 Flush all state, indexes and buffers to disk. More...
 
bool AcceptToMemoryPool (CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, bool fOverrideMempoolLimit=false, bool fRejectInsaneFee=false, bool ignoreFees=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 (try to) add transaction to memory pool More...
 
bool AcceptToMemoryPoolWithTime (CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit=false, bool fRejectInsaneFee=false, bool ignoreFees=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 (try to) add transaction to memory pool with a specified acceptance time More...
 
CAmount GetMinRelayFee (const CTransaction &tx, const CTxMemPool &pool, unsigned int nBytes)
 
CAmount GetMinRelayFee (unsigned int nBytes)
 
CAmount GetShieldedTxMinFee (const CTransaction &tx)
 Return the minimum fee for a shielded tx. More...
 
bool CheckInputs (const CTransaction &tx, CValidationState &state, const CCoinsViewCache &view, bool fScriptChecks, unsigned int flags, bool cacheStore, PrecomputedTransactionData &precomTxData, std::vector< CScriptCheck > *pvChecks=nullptr)
 Check transaction inputs, and make sure any pay-to-script-hash transactions are evaluating IsStandard scripts. More...
 
void UpdateCoins (const CTransaction &tx, CCoinsViewCache &inputs, int nHeight, bool fSkipInvalid=false)
 Apply the effects of this transaction on the UTXO set represented by view. More...
 
bool CheckFinalTx (const CTransactionRef &tx, int flags=-1)
 Check if transaction will be final in the next block to be created. More...
 
bool WriteBlockToDisk (const CBlock &block, FlatFilePos &pos)
 Functions for disk access for blocks. More...
 
bool ReadBlockFromDisk (CBlock &block, const FlatFilePos &pos)
 
bool ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex)
 
bool CheckBlock (const CBlock &block, CValidationState &state, bool fCheckPOW=true, bool fCheckMerkleRoot=true, bool fCheckSig=true) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Functions for validating blocks and updating the block tree. More...
 
bool CheckWork (const CBlock &block, const CBlockIndex *const pindexPrev)
 
bool ContextualCheckBlockHeader (const CBlockHeader &block, CValidationState &state, CBlockIndex *pindexPrev) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Context-dependent validity checks. More...
 
bool ContextualCheckBlock (const CBlock &block, CValidationState &state, CBlockIndex *pindexPrev)
 
bool TestBlockValidity (CValidationState &state, const CBlock &block, CBlockIndex *pindexPrev, bool fCheckPOW=true, bool fCheckMerkleRoot=true, bool fCheckBlockSig=true) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) More...
 
bool AcceptBlockHeader (const CBlock &block, CValidationState &state, CBlockIndex **ppindex=nullptr, CBlockIndex *pindexPrev=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
bool ReplayBlocks (const CChainParams &params, CCoinsView *view)
 Replay blocks that aren't fully applied to the database. More...
 
CBlockIndexLookupBlockIndex (const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
CBlockIndexFindForkInGlobalIndex (const CChain &chain, const CBlockLocator &locator) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Find the last common block between the parameter chain and a locator. More...
 
bool InvalidateBlock (CValidationState &state, const CChainParams &chainparams, CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Mark a block as invalid. More...
 
bool ReconsiderBlock (CValidationState &state, CBlockIndex *pindex)
 Remove invalidity status from a block and its descendants. More...
 
CBlockIndexGetChainTip ()
 Return a reliable pointer (in mapBlockIndex) to the chain's tip index. More...
 
int GetSpendHeight (const CCoinsViewCache &inputs)
 Return the spend height, which is one more than the inputs.GetBestBlock(). More...
 
CBlockFileInfoGetBlockFileInfo (size_t n)
 Get block file info entry for one block file. More...
 
bool DumpMempool (const CTxMemPool &pool)
 Dump the mempool to disk. More...
 
bool LoadMempool (CTxMemPool &pool)
 Load the mempool from disk. More...
 

Variables

CScript COINBASE_FLAGS
 Constant stuff for coinbase transactions we create: More...
 
RecursiveMutex cs_main
 Global state. More...
 
CTxMemPool mempool
 
BlockMap mapBlockIndex
 
PrevBlockMap mapPrevBlockIndex
 
uint64_t nLastBlockTx
 
uint64_t nLastBlockSize
 
Mutex g_best_block_mutex
 
std::condition_variable g_best_block_cv
 
uint256 g_best_block
 
int64_t g_best_block_time
 
std::atomic< bool > fImporting
 
std::atomic< bool > fReindex
 
int nScriptCheckThreads
 
bool fTxIndex
 
bool fRequireStandard
 
bool fCheckBlockIndex
 
size_t nCoinCacheUsage
 
CFeeRate minRelayTxFee
 Fees smaller than this (in upiv) are considered zero fee (for relaying, mining and transaction creation) We are ~100 times smaller then bitcoin now (2015-06-23), set minRelayTxFee only 10 times higher so it's still 10 times lower comparing to bitcoin. More...
 
int64_t nMaxTipAge
 
bool fLargeWorkForkFound
 
bool fLargeWorkInvalidChainFound
 
std::map< uint256, int64_t > mapRejectedBlocks
 
CMoneySupply MoneySupply
 
CBlockIndexpindexBestHeader
 Best header we've seen so far (used for getheaders queries' starting points). More...
 
CChain chainActive
 The currently-connected chain of blocks (protected by cs_main). More...
 
std::unique_ptr< CCoinsViewDBpcoinsdbview
 Global variable that points to the coins database (protected by cs_main) More...
 
std::unique_ptr< CCoinsViewCachepcoinsTip
 Global variable that points to the active CCoinsView (protected by cs_main) More...
 
std::unique_ptr< CBlockTreeDBpblocktree
 Global variable that points to the active block tree (protected by cs_main) More...
 
std::unique_ptr< CZerocoinDBzerocoinDB
 Global variable that points to the zerocoin database (protected by cs_main) More...
 
std::unique_ptr< AccumulatorCacheaccumulatorCache
 In-memory cache for the zerocoin accumulators. More...
 
std::unique_ptr< CSporkDBpSporkDB
 Global variable that points to the spork database (protected by cs_main) More...
 

Typedef Documentation

◆ BlockMap

typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap

Definition at line 126 of file validation.h.

◆ PrevBlockMap

typedef std::unordered_multimap<uint256, CBlockIndex*, BlockHasher> PrevBlockMap

Definition at line 127 of file validation.h.

Function Documentation

◆ AcceptBlockHeader()

bool AcceptBlockHeader ( const CBlock block,
CValidationState state,
CBlockIndex **  ppindex = nullptr,
CBlockIndex pindexPrev = nullptr 
)
Todo:
: ENABLE BLOCK CACHE IN SPECIFIC CASES

Definition at line 3034 of file validation.cpp.

Here is the call graph for this function:

◆ AcceptToMemoryPool()

bool AcceptToMemoryPool ( CTxMemPool pool,
CValidationState state,
const CTransactionRef tx,
bool  fLimitFree,
bool *  pfMissingInputs,
bool  fOverrideMempoolLimit = false,
bool  fRejectInsaneFee = false,
bool  ignoreFees = false 
)

(try to) add transaction to memory pool

Definition at line 649 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AcceptToMemoryPoolWithTime()

bool AcceptToMemoryPoolWithTime ( CTxMemPool pool,
CValidationState state,
const CTransactionRef tx,
bool  fLimitFree,
bool *  pfMissingInputs,
int64_t  nAcceptTime,
bool  fOverrideMempoolLimit = false,
bool  fRejectInsaneFee = false,
bool  ignoreFees = false 
)

(try to) add transaction to memory pool with a specified acceptance time

Definition at line 632 of file validation.cpp.

Here is the caller graph for this function:

◆ ActivateBestChain()

bool ActivateBestChain ( CValidationState state,
std::shared_ptr< const CBlock pblock 
)

Find the best known block, and make it the tip of the block chain.

Find the best known block, and make it the tip of the block chain.

The result is either failure or an activated best chain. pblock is either nullptr or a pointer to a block that is already loaded (to avoid loading it again from disk).

Definition at line 2280 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ActiveProtocol()

int ActiveProtocol ( )

See whether the protocol update is enforced for connected nodes.

Definition at line 4222 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckBlock()

bool CheckBlock ( const CBlock block,
CValidationState state,
bool  fCheckPOW = true,
bool  fCheckMerkleRoot = true,
bool  fCheckSig = true 
)

Functions for validating blocks and updating the block tree.

Context-independent validity checks

Definition at line 2701 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckFinalTx()

bool CheckFinalTx ( const CTransactionRef tx,
int  flags = -1 
)

Check if transaction will be final in the next block to be created.

Calls IsFinalTx() with current block height and appropriate block time.

See consensus/consensus.h for flag definitions.

Definition at line 224 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckInputs()

bool CheckInputs ( const CTransaction tx,
CValidationState state,
const CCoinsViewCache view,
bool  fScriptChecks,
unsigned int  flags,
bool  cacheStore,
PrecomputedTransactionData precomTxData,
std::vector< CScriptCheck > *  pvChecks = nullptr 
)

Check transaction inputs, and make sure any pay-to-script-hash transactions are evaluating IsStandard scripts.

Why bother? To avoid denial-of-service attacks; an attacker can submit a standard HASH... OP_EQUAL transaction, which will get accepted into blocks. The redemption script can be anything; an attacker could use a very expensive-to-check-upon-redemption script like: DUP CHECKSIG DROP ... repeated 100 times... OP_1 Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts) This does not modify the UTXO set. If pvChecks is not nullptr, script checks are pushed onto it instead of being performed inline.

Definition at line 1104 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckWork()

bool CheckWork ( const CBlock block,
const CBlockIndex *const  pindexPrev 
)

Definition at line 2833 of file validation.cpp.

Here is the call graph for this function:

◆ ContextualCheckBlock()

bool ContextualCheckBlock ( const CBlock block,
CValidationState state,
CBlockIndex pindexPrev 
)

Definition at line 2958 of file validation.cpp.

Here is the call graph for this function:

◆ ContextualCheckBlockHeader()

bool ContextualCheckBlockHeader ( const CBlockHeader block,
CValidationState state,
CBlockIndex pindexPrev 
)

Context-dependent validity checks.

Definition at line 2909 of file validation.cpp.

Here is the call graph for this function:

◆ ConvertBitsToDouble()

double ConvertBitsToDouble ( unsigned int  nBits)

Definition at line 797 of file validation.cpp.

Here is the caller graph for this function:

◆ DumpMempool()

bool DumpMempool ( const CTxMemPool pool)

Dump the mempool to disk.

Definition at line 4312 of file validation.cpp.

Here is the call graph for this function:

◆ FindForkInGlobalIndex()

CBlockIndex* FindForkInGlobalIndex ( const CChain chain,
const CBlockLocator locator 
)

Find the last common block between the parameter chain and a locator.

Definition at line 181 of file validation.cpp.

Here is the call graph for this function:

◆ FlushStateToDisk()

void FlushStateToDisk ( )

Flush all state, indexes and buffers to disk.

Definition at line 1848 of file validation.cpp.

◆ GetBlockFileInfo()

CBlockFileInfo* GetBlockFileInfo ( size_t  n)

Get block file info entry for one block file.

Definition at line 4240 of file validation.cpp.

Here is the caller graph for this function:

◆ GetBlockPosFilename()

fs::path GetBlockPosFilename ( const FlatFilePos pos)

Translation to a filesystem path.

Definition at line 3504 of file validation.cpp.

Here is the caller graph for this function:

◆ GetBlockValue()

CAmount GetBlockValue ( int  nHeight)

Definition at line 816 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetChainTip()

CBlockIndex* GetChainTip ( )

Return a reliable pointer (in mapBlockIndex) to the chain's tip index.

Definition at line 194 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMasternodePayment()

int64_t GetMasternodePayment ( int  nHeight)

Definition at line 852 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMinRelayFee() [1/2]

CAmount GetMinRelayFee ( const CTransaction tx,
const CTxMemPool pool,
unsigned int  nBytes 
)

Definition at line 265 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMinRelayFee() [2/2]

CAmount GetMinRelayFee ( unsigned int  nBytes)

Definition at line 279 of file validation.cpp.

Here is the call graph for this function:

◆ GetOutput()

bool GetOutput ( const uint256 hash,
unsigned int  index,
CValidationState state,
CTxOut out 
)

Retrieve an output (from memory pool, or from disk, if possible)

Definition at line 656 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetShieldedTxMinFee()

CAmount GetShieldedTxMinFee ( const CTransaction tx)

Return the minimum fee for a shielded tx.

Definition at line 288 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSpendHeight()

int GetSpendHeight ( const CCoinsViewCache inputs)

Return the spend height, which is one more than the inputs.GetBestBlock().

While checking, GetBestBlock() refers to the parent block. (protected by cs_main) This is also true for mempool checks.

Definition at line 1044 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTransaction()

bool GetTransaction ( const uint256 hash,
CTransactionRef txOut,
uint256 hashBlock,
bool  fAllowSlow,
CBlockIndex blockIndex 
)

Retrieve a transaction (from memory pool, or from disk, if possible)

Retrieve a transaction (from memory pool, or from disk, if possible)

Definition at line 671 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InsertBlockIndex()

CBlockIndex* InsertBlockIndex ( const uint256 hash)

Create a new block index entry for a given block hash.

Definition at line 3509 of file validation.cpp.

Here is the call graph for this function:

◆ InvalidateBlock()

bool InvalidateBlock ( CValidationState state,
const CChainParams chainparams,
CBlockIndex pindex 
)

Mark a block as invalid.

Definition at line 2376 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsInitialBlockDownload()

bool IsInitialBlockDownload ( )

Check whether we are doing an initial block download (synchronizing from disk or network)

Definition at line 862 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadBlockIndex()

bool LoadBlockIndex ( std::string &  strError)

Load the block tree and coins database from disk, initializing state if we're running with -reindex.

Definition at line 3903 of file validation.cpp.

◆ LoadChainTip()

bool LoadChainTip ( const CChainParams chainparams)

Update the chain tip based on database information.

Definition at line 3642 of file validation.cpp.

Here is the call graph for this function:

◆ LoadExternalBlockFile()

bool LoadExternalBlockFile ( FILE *  fileIn,
FlatFilePos dbp = nullptr 
)

Import blocks from an external file.

Definition at line 3962 of file validation.cpp.

Here is the call graph for this function:

◆ LoadGenesisBlock()

bool LoadGenesisBlock ( )

Ensures we have a genesis block in the block tree, possibly writing one to disk.

Definition at line 3930 of file validation.cpp.

Here is the call graph for this function:

◆ LoadMempool()

bool LoadMempool ( CTxMemPool pool)

Load the mempool from disk.

Definition at line 4247 of file validation.cpp.

Here is the call graph for this function:

◆ LookupBlockIndex()

CBlockIndex* LookupBlockIndex ( const uint256 hash)
inline

Definition at line 345 of file validation.h.

Here is the caller graph for this function:

◆ OpenBlockFile()

FILE* OpenBlockFile ( const FlatFilePos pos,
bool  fReadOnly = false 
)

Open a block file (blk?????.dat)

Definition at line 3494 of file validation.cpp.

Here is the caller graph for this function:

◆ OpenUndoFile()

FILE* OpenUndoFile ( const FlatFilePos pos,
bool  fReadOnly = false 
)

Open an undo file (rev?????.dat)

Definition at line 3499 of file validation.cpp.

◆ ProcessNewBlock()

bool ProcessNewBlock ( const std::shared_ptr< const CBlock > &  pblock,
const FlatFilePos dbp 
)

Process an incoming block.

This only returns after the best known valid block is made active. Note that it does not, however, guarantee that the specific block passed to it has been checked for validity!

If you want to possibly get feedback on whether pblock is valid, you must install a CValidationInterface (see validationinterface.h) - this will have its BlockChecked method called whenever any block completes validation.

Note that we guarantee that either the proof-of-work is valid on pblock, or (and possibly also) BlockChecked will have been called.

Parameters
[in]pblockThe block we want to process.
[out]dbpThe already known disk position of pblock, or nullptr if not yet stored.
Returns
True if state.IsValid()

Definition at line 3412 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBlockFromDisk() [1/2]

bool ReadBlockFromDisk ( CBlock block,
const CBlockIndex pindex 
)

Definition at line 783 of file validation.cpp.

Here is the call graph for this function:

◆ ReadBlockFromDisk() [2/2]

bool ReadBlockFromDisk ( CBlock block,
const FlatFilePos pos 
)

Definition at line 758 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReconsiderBlock()

bool ReconsiderBlock ( CValidationState state,
CBlockIndex pindex 
)

Remove invalidity status from a block and its descendants.

Definition at line 2419 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReplayBlocks()

bool ReplayBlocks ( const CChainParams params,
CCoinsView view 
)

Replay blocks that aren't fully applied to the database.

Definition at line 3813 of file validation.cpp.

Here is the call graph for this function:

◆ TestBlockValidity()

bool TestBlockValidity ( CValidationState state,
const CBlock block,
CBlockIndex pindexPrev,
bool  fCheckPOW = true,
bool  fCheckMerkleRoot = true,
bool  fCheckBlockSig = true 
)

Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held)

Definition at line 3450 of file validation.cpp.

Here is the call graph for this function:

◆ ThreadScriptCheck()

void ThreadScriptCheck ( )

Run an instance of the script checking thread.

Definition at line 1413 of file validation.cpp.

Here is the call graph for this function:

◆ UnloadBlockIndex()

void UnloadBlockIndex ( )

Unload database information.

Definition at line 3882 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateCoins()

void UpdateCoins ( const CTransaction tx,
CCoinsViewCache inputs,
int  nHeight,
bool  fSkipInvalid = false 
)

Apply the effects of this transaction on the UTXO set represented by view.

Definition at line 1032 of file validation.cpp.

Here is the call graph for this function:

◆ WriteBlockToDisk()

bool WriteBlockToDisk ( const CBlock block,
FlatFilePos pos 
)

Functions for disk access for blocks.

Definition at line 737 of file validation.cpp.

Here is the call graph for this function:

Variable Documentation

◆ accumulatorCache

std::unique_ptr<AccumulatorCache> accumulatorCache
extern

In-memory cache for the zerocoin accumulators.

Definition at line 210 of file validation.cpp.

◆ chainActive

CChain chainActive
extern

The currently-connected chain of blocks (protected by cs_main).

Definition at line 84 of file validation.cpp.

◆ COINBASE_FLAGS

CScript COINBASE_FLAGS
extern

Constant stuff for coinbase transactions we create:

Definition at line 119 of file validation.cpp.

◆ cs_main

RecursiveMutex cs_main
extern

Global state.

Mutex to guard access to validation specific variables, such as reading or changing the chainstate.

This may also need to be locked when updating the transaction pool, e.g. on AcceptToMemoryPool. See CTxMemPool::cs comment for details.

The transaction pool has a separate lock to allow reading from it and the chainstate at the same time.

Definition at line 80 of file validation.cpp.

◆ fCheckBlockIndex

bool fCheckBlockIndex
extern

Definition at line 98 of file validation.cpp.

◆ fImporting

std::atomic<bool> fImporting
extern

Definition at line 94 of file validation.cpp.

◆ fLargeWorkForkFound

bool fLargeWorkForkFound
extern

Definition at line 14 of file warnings.cpp.

◆ fLargeWorkInvalidChainFound

bool fLargeWorkInvalidChainFound
extern

Definition at line 15 of file warnings.cpp.

◆ fReindex

std::atomic<bool> fReindex
extern

Definition at line 95 of file validation.cpp.

◆ fRequireStandard

bool fRequireStandard
extern

Definition at line 97 of file validation.cpp.

◆ fTxIndex

bool fTxIndex
extern

Definition at line 96 of file validation.cpp.

◆ g_best_block

uint256 g_best_block
extern

Definition at line 90 of file validation.cpp.

◆ g_best_block_cv

std::condition_variable g_best_block_cv
extern

Definition at line 89 of file validation.cpp.

◆ g_best_block_mutex

Mutex g_best_block_mutex
extern

Definition at line 88 of file validation.cpp.

◆ g_best_block_time

int64_t g_best_block_time
extern

Definition at line 91 of file validation.cpp.

◆ mapBlockIndex

BlockMap mapBlockIndex
extern

Definition at line 82 of file validation.cpp.

◆ mapPrevBlockIndex

PrevBlockMap mapPrevBlockIndex
extern

Definition at line 83 of file validation.cpp.

◆ mapRejectedBlocks

std::map<uint256, int64_t> mapRejectedBlocks
extern

Definition at line 112 of file validation.cpp.

◆ mempool

CTxMemPool mempool
extern

◆ minRelayTxFee

CFeeRate minRelayTxFee
extern

Fees smaller than this (in upiv) are considered zero fee (for relaying, mining and transaction creation) We are ~100 times smaller then bitcoin now (2015-06-23), set minRelayTxFee only 10 times higher so it's still 10 times lower comparing to bitcoin.

Definition at line 108 of file validation.cpp.

◆ MoneySupply

CMoneySupply MoneySupply
extern

Definition at line 114 of file validation.cpp.

◆ nCoinCacheUsage

size_t nCoinCacheUsage
extern

Definition at line 99 of file validation.cpp.

◆ nLastBlockSize

uint64_t nLastBlockSize
extern

Definition at line 41 of file blockassembler.cpp.

◆ nLastBlockTx

uint64_t nLastBlockTx
extern

Definition at line 40 of file blockassembler.cpp.

◆ nMaxTipAge

int64_t nMaxTipAge
extern

Definition at line 102 of file validation.cpp.

◆ nScriptCheckThreads

int nScriptCheckThreads
extern

Definition at line 93 of file validation.cpp.

◆ pblocktree

std::unique_ptr<CBlockTreeDB> pblocktree
extern

Global variable that points to the active block tree (protected by cs_main)

Definition at line 207 of file validation.cpp.

◆ pcoinsdbview

std::unique_ptr<CCoinsViewDB> pcoinsdbview
extern

Global variable that points to the coins database (protected by cs_main)

Definition at line 205 of file validation.cpp.

◆ pcoinsTip

std::unique_ptr<CCoinsViewCache> pcoinsTip
extern

Global variable that points to the active CCoinsView (protected by cs_main)

Definition at line 206 of file validation.cpp.

◆ pindexBestHeader

CBlockIndex* pindexBestHeader
extern

Best header we've seen so far (used for getheaders queries' starting points).

Definition at line 85 of file validation.cpp.

◆ pSporkDB

std::unique_ptr<CSporkDB> pSporkDB
extern

Global variable that points to the spork database (protected by cs_main)

Definition at line 209 of file validation.cpp.

◆ zerocoinDB

std::unique_ptr<CZerocoinDB> zerocoinDB
extern

Global variable that points to the zerocoin database (protected by cs_main)

Definition at line 208 of file validation.cpp.