Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <amount.h>
#include <coins.h>
#include <fs.h>
#include <protocol.h>
#include <policy/feerate.h>
#include <script/script_error.h>
#include <sync.h>
#include <versionbits.h>
#include <spentindex.h>
#include <algorithm>
#include <exception>
#include <map>
#include <memory>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
#include <atomic>
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 *, BlockHasher > | BlockMap |
typedef std::unordered_multimap< uint256, CBlockIndex *, BlockHasher > | PrevBlockMap |
Functions | |
bool | ProcessNewBlock (const CChainParams &chainparams, const std::shared_ptr< const CBlock > pblock, bool fForceProcessing, bool *fNewBlock) |
Process an incoming block. More... | |
bool | ProcessNewBlockHeaders (const std::vector< CBlockHeader > &block, CValidationState &state, const CChainParams &chainparams, const CBlockIndex **ppindex=nullptr, CBlockHeader *first_invalid=nullptr) |
Process incoming block headers. More... | |
bool | CheckDiskSpace (uint64_t nAdditionalBytes=0) |
Check whether enough disk space is available for an incoming block. More... | |
FILE * | OpenBlockFile (const CDiskBlockPos &pos, bool fReadOnly=false) |
Open a block file (blk?????.dat) More... | |
fs::path | GetBlockPosFilename (const CDiskBlockPos &pos, const char *prefix) |
Translation to a filesystem path. More... | |
bool | LoadExternalBlockFile (const CChainParams &chainparams, FILE *fileIn, CDiskBlockPos *dbp=nullptr) |
Import blocks from an external file. More... | |
bool | LoadGenesisBlock (const CChainParams &chainparams) |
Ensures we have a genesis block in the block tree, possibly writing one to disk. More... | |
bool | LoadBlockIndex (const CChainParams &chainparams) |
Load the block tree and coins database from disk, initializing state if we're running with -reindex. More... | |
bool | LoadChainTip (const CChainParams &chainparams) |
Update the chain tip based on database information. More... | |
void | UnloadBlockIndex () |
Unload database information. 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, const Consensus::Params ¶ms, uint256 &hashBlock, bool fAllowSlow=false, CBlockIndex *blockIndex=nullptr) |
Retrieve a transaction (from memory pool, or from disk, if possible) More... | |
bool | ActivateBestChain (CValidationState &state, const CChainParams &chainparams, 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... | |
double | ConvertBitsToDouble (unsigned int nBits) |
CAmount | GetBlockSubsidy (int nBits, int nHeight, const Consensus::Params &consensusParams, bool fSuperblockPartOnly=false) |
CAmount | GetMasternodePayment (int nHeight, CAmount blockValue, int nReallocActivationHeight=std::numeric_limits< int >::max()) |
double | GuessVerificationProgress (const ChainTxData &data, const CBlockIndex *pindex) |
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). More... | |
uint64_t | CalculateCurrentUsage () |
Calculate the amount of disk space the block & undo files currently use. More... | |
void | PruneOneBlockFile (const int fileNumber) |
Mark one block file as pruned. More... | |
void | UnlinkPrunedFiles (const std::set< int > &setFilesToPrune) |
Actually unlink the specified files. More... | |
void | FlushStateToDisk () |
Flush all state, indexes and buffers to disk. More... | |
void | PruneAndFlush () |
Prune block files and flush state to disk. More... | |
void | PruneBlockFilesManual (int nManualPruneHeight) |
Prune block files up to a given height. More... | |
bool | AcceptToMemoryPool (CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool *pfMissingInputs, bool bypass_limits, const CAmount nAbsurdFee, bool fDryRun=false) |
(try to) add transaction to memory pool More... | |
static bool | AcceptToMemoryPoolWithTime (const CChainParams &chainparams, CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool *pfMissingInputs, int64_t nAcceptTime, bool bypass_limits, const CAmount nAbsurdFee, bool fDryRun=false) |
bool | GetUTXOCoin (const COutPoint &outpoint, Coin &coin) |
int | GetUTXOHeight (const COutPoint &outpoint) |
int | GetUTXOConfirmations (const COutPoint &outpoint) |
std::string | FormatStateMessage (const CValidationState &state) |
Convert CValidationState to a human-readable message for logging. More... | |
ThresholdState | VersionBitsTipState (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
Get the BIP9 state for a given deployment at the current tip. More... | |
BIP9Stats | VersionBitsTipStatistics (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
Get the numerical statistics for the BIP9 state for a given deployment at the current tip. More... | |
int | VersionBitsTipStateSinceHeight (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
Get the block height at which the BIP9 deployment switched into the state for the block building on the current tip. More... | |
void | UpdateCoins (const CTransaction &tx, CCoinsViewCache &inputs, int nHeight) |
Apply the effects of this transaction on the UTXO set represented by view. More... | |
bool | CheckFinalTx (const CTransaction &tx, int flags=-1) |
Transaction validation functions. More... | |
bool | TestLockPointValidity (const LockPoints *lp) |
Test whether the LockPoints height and time are still valid on the current chain. More... | |
bool | CheckSequenceLocks (const CTransaction &tx, int flags, LockPoints *lp=nullptr, bool useExistingLockPoints=false) |
Check if transaction will be BIP 68 final in the next block to be created. More... | |
bool | GetTimestampIndex (const unsigned int &high, const unsigned int &low, std::vector< uint256 > &hashes) |
bool | GetSpentIndex (CSpentIndexKey &key, CSpentIndexValue &value) |
bool | GetAddressIndex (uint160 addressHash, int type, std::vector< std::pair< CAddressIndexKey, CAmount > > &addressIndex, int start=0, int end=0) |
bool | GetAddressUnspent (uint160 addressHash, int type, std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &unspentOutputs) |
void | InitScriptExecutionCache () |
Initializes the script-execution cache. More... | |
bool | ReadBlockFromDisk (CBlock &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams) |
Functions for disk access for blocks. More... | |
bool | ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex, const Consensus::Params &consensusParams) |
bool | CheckBlock (const CBlock &block, CValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW=true, bool fCheckMerkleRoot=true) |
Functions for validating blocks and updating the block tree. More... | |
bool | TestBlockValidity (CValidationState &state, const CChainParams &chainparams, const CBlock &block, CBlockIndex *pindexPrev, bool fCheckPOW=true, bool fCheckMerkleRoot=true) |
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 | ReplayBlocks (const CChainParams ¶ms, CCoinsView *view) |
Replay blocks that aren't fully applied to the database. More... | |
CBlockIndex * | FindForkInGlobalIndex (const CChain &chain, const CBlockLocator &locator) |
Find the last common block between the parameter chain and a locator. More... | |
bool | PreciousBlock (CValidationState &state, const CChainParams ¶ms, CBlockIndex *pindex) |
Mark a block as precious and reorganize. More... | |
bool | InvalidateBlock (CValidationState &state, const CChainParams &chainparams, CBlockIndex *pindex) |
Mark a block as invalid. More... | |
bool | ResetBlockFailureFlags (CBlockIndex *pindex) |
Remove invalidity status from a block and its descendants. More... | |
int | GetSpendHeight (const CCoinsViewCache &inputs) |
Return the spend height, which is one more than the inputs.GetBestBlock(). More... | |
int32_t | ComputeBlockVersion (const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, bool fCheckMasternodesUpgraded=false) |
Determine what nVersion a new block should use. More... | |
bool | GetBlockHash (uint256 &hashRet, int nBlockHeight=-1) |
Return true if hash can be found in chainActive at nBlockHeight height. More... | |
CBlockFileInfo * | GetBlockFileInfo (size_t n) |
Get block file info entry for one block file. More... | |
bool | DumpMempool () |
Dump the mempool to disk. More... | |
bool | LoadMempool () |
Load the mempool from disk. More... | |
Variables | |
static const bool | DEFAULT_WHITELISTRELAY = true |
Default for -whitelistrelay. More... | |
static const bool | DEFAULT_WHITELISTFORCERELAY = true |
Default for -whitelistforcerelay. More... | |
static const unsigned int | DEFAULT_MIN_RELAY_TX_FEE = 1000 |
Default for -minrelaytxfee, minimum relay fee for transactions. More... | |
static const CAmount | DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN |
-maxtxfee default More... | |
static const CAmount | HIGH_TX_FEE_PER_KB = 0.01 * COIN |
Discourage users to set fees higher than this amount (in duffs) per kB. More... | |
static const CAmount | HIGH_MAX_TX_FEE = 100 * HIGH_TX_FEE_PER_KB |
-maxtxfee will warn if called with a higher fee than this amount (in duffs) More... | |
static const unsigned int | DEFAULT_ANCESTOR_LIMIT = 25 |
Default for -limitancestorcount, max number of in-mempool ancestors. More... | |
static const unsigned int | DEFAULT_ANCESTOR_SIZE_LIMIT = 101 |
Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors. More... | |
static const unsigned int | DEFAULT_DESCENDANT_LIMIT = 25 |
Default for -limitdescendantcount, max number of in-mempool descendants. More... | |
static const unsigned int | DEFAULT_DESCENDANT_SIZE_LIMIT = 101 |
Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants. More... | |
static const unsigned int | DEFAULT_MEMPOOL_EXPIRY = 336 |
Default for -mempoolexpiry, expiration time for mempool transactions in hours. More... | |
static const unsigned int | MAX_DISCONNECTED_TX_POOL_SIZE = 20000 |
Maximum kilobytes for transactions to store for processing during reorg. More... | |
static const unsigned int | MAX_BLOCKFILE_SIZE = 0x8000000 |
The maximum size of a blk?????.dat file (since 0.8) More... | |
static const unsigned int | BLOCKFILE_CHUNK_SIZE = 0x1000000 |
The pre-allocation chunk size for blk?????.dat files (since 0.8) More... | |
static const unsigned int | UNDOFILE_CHUNK_SIZE = 0x100000 |
The pre-allocation chunk size for rev?????.dat files (since 0.8) More... | |
static const int | MAX_SCRIPTCHECK_THREADS = 16 |
Maximum number of script-checking threads allowed. More... | |
static const int | DEFAULT_SCRIPTCHECK_THREADS = 0 |
-par default (number of script-checking threads, 0 = auto) More... | |
static const int | MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16 |
Number of blocks that can be requested at any given time from a single peer. More... | |
static const unsigned int | BLOCK_STALLING_TIMEOUT = 2 |
Timeout in seconds during which a peer must stall block download progress before being disconnected. More... | |
static const unsigned int | MAX_HEADERS_RESULTS = 2000 |
Number of headers sent in one getheaders result. More... | |
static const int | MAX_CMPCTBLOCK_DEPTH = 5 |
Maximum depth of blocks we're willing to serve as compact blocks to peers when requested. More... | |
static const int | MAX_BLOCKTXN_DEPTH = 10 |
Maximum depth of blocks we're willing to respond to GETBLOCKTXN requests for. More... | |
static const unsigned int | BLOCK_DOWNLOAD_WINDOW = 1024 |
Size of the "block download window": how far ahead of our current height do we fetch? Larger windows tolerate larger download speed differences between peer, but increase the potential degree of disordering of blocks on disk (which make reindexing and pruning harder). More... | |
static const unsigned int | DATABASE_WRITE_INTERVAL = 60 * 60 |
Time to wait (in seconds) between writing blocks/block index to disk. More... | |
static const unsigned int | DATABASE_FLUSH_INTERVAL = 24 * 60 * 60 |
Time to wait (in seconds) between flushing chainstate to disk. More... | |
static const unsigned int | MAX_REJECT_MESSAGE_LENGTH = 111 |
Maximum length of reject messages. More... | |
static const int64_t | BLOCK_DOWNLOAD_TIMEOUT_BASE = 1000000 |
Block download timeout base, expressed in millionths of the block interval (i.e. More... | |
static const int64_t | BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 500000 |
Additional block download timeout per parallel downloading peer (i.e. More... | |
static const int64_t | DEFAULT_MAX_TIP_AGE = 6 * 60 * 60 |
static const int64_t | MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60 |
Maximum age of our tip in seconds for us to be considered current for fee estimation. More... | |
static const bool | DEFAULT_PERMIT_BAREMULTISIG = true |
Default for -permitbaremultisig. More... | |
static const unsigned int | DEFAULT_BYTES_PER_SIGOP = 20 |
static const bool | DEFAULT_CHECKPOINTS_ENABLED = true |
static const bool | DEFAULT_TXINDEX = true |
static const bool | DEFAULT_ADDRESSINDEX = false |
static const bool | DEFAULT_TIMESTAMPINDEX = false |
static const bool | DEFAULT_SPENTINDEX = false |
static const unsigned int | DEFAULT_BANSCORE_THRESHOLD = 100 |
static const bool | DEFAULT_PERSIST_MEMPOOL = true |
Default for -persistmempool. More... | |
static const bool | DEFAULT_SYNC_MEMPOOL = true |
Default for -syncmempool. More... | |
static const unsigned int | MAX_BLOCKS_TO_ANNOUNCE = 8 |
Maximum number of headers to announce when relaying blocks with headers message. More... | |
static const int | MAX_UNCONNECTING_HEADERS = 10 |
Maximum number of unconnecting headers announcements before DoS score. More... | |
static const bool | DEFAULT_PEERBLOOMFILTERS = true |
static const int | DEFAULT_STOPATHEIGHT = 0 |
Default for -stopatheight. More... | |
CScript | COINBASE_FLAGS |
Constant stuff for coinbase transactions we create: More... | |
CCriticalSection | cs_main |
CBlockPolicyEstimator | feeEstimator |
CTxMemPool | mempool |
BlockMap & | mapBlockIndex |
PrevBlockMap & | mapPrevBlockIndex |
uint64_t | nLastBlockTx |
uint64_t | nLastBlockSize |
const std::string | strMessageMagic |
CWaitableCriticalSection | g_best_block_mutex |
CConditionVariable | g_best_block_cv |
uint256 | g_best_block |
std::atomic_bool | fImporting |
std::atomic_bool | fReindex |
int | nScriptCheckThreads |
bool | fTxIndex |
bool | fAddressIndex |
bool | fTimestampIndex |
bool | fSpentIndex |
bool | fIsBareMultisigStd |
bool | fRequireStandard |
unsigned int | nBytesPerSigOp |
bool | fCheckBlockIndex |
bool | fCheckpointsEnabled |
size_t | nCoinCacheUsage |
CFeeRate | minRelayTxFee |
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) More... | |
CAmount | maxTxFee |
Absolute maximum transaction fee (in duffs) used by wallet and mempool (rejects high fee in sendrawtransaction) More... | |
int64_t | nMaxTipAge |
If the tip is older than this (in seconds), the node is considered to be in initial block download. More... | |
bool | fLargeWorkForkFound |
bool | fLargeWorkInvalidChainFound |
std::atomic< bool > | fDIP0001ActiveAtTip |
uint256 | hashAssumeValid |
Block hash whose ancestors we will assume to have valid scripts without checking them. More... | |
arith_uint256 | nMinimumChainWork |
Minimum work we will assume exists on some valid chain. More... | |
CBlockIndex * | pindexBestHeader |
Best header we've seen so far (used for getheaders queries' starting points). More... | |
static const uint64_t | nMinDiskSpace = 52428800 |
Minimum disk space required - used in CheckDiskSpace() More... | |
bool | fHavePruned |
Pruning-related variables and constants. More... | |
bool | fPruneMode |
True if we're running in -prune mode. More... | |
uint64_t | nPruneTarget |
Number of MiB of block files that we're trying to stay below. More... | |
static const unsigned int | MIN_BLOCKS_TO_KEEP = 288 |
Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. More... | |
static const unsigned int | NODE_NETWORK_LIMITED_MIN_BLOCKS = 288 |
Minimum blocks required to signal NODE_NETWORK_LIMITED. More... | |
static const signed int | DEFAULT_CHECKBLOCKS = 6 |
static const unsigned int | DEFAULT_CHECKLEVEL = 3 |
static const uint64_t | MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024 |
CChain & | chainActive |
The currently-connected chain of blocks (protected by cs_main). More... | |
std::unique_ptr< CCoinsViewDB > | pcoinsdbview |
Global variable that points to the coins database (protected by cs_main) More... | |
std::unique_ptr< CCoinsViewCache > | pcoinsTip |
Global variable that points to the active CCoinsView (protected by cs_main) More... | |
std::unique_ptr< CBlockTreeDB > | pblocktree |
Global variable that points to the active block tree (protected by cs_main) More... | |
VersionBitsCache | versionbitscache |
static const unsigned int | REJECT_INTERNAL = 0x100 |
Reject codes greater or equal to this can be returned by AcceptToMemPool for transactions, to signal internal conditions. More... | |
static const unsigned int | REJECT_HIGHFEE = 0x100 |
Too high fee. More... | |
Typedef Documentation
◆ BlockMap
typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap |
Definition at line 152 of file validation.h.
◆ PrevBlockMap
typedef std::unordered_multimap<uint256, CBlockIndex*, BlockHasher> PrevBlockMap |
Definition at line 153 of file validation.h.
Function Documentation
◆ AcceptToMemoryPool()
bool AcceptToMemoryPool | ( | CTxMemPool & | pool, |
CValidationState & | state, | ||
const CTransactionRef & | tx, | ||
bool * | pfMissingInputs, | ||
bool | bypass_limits, | ||
const CAmount | nAbsurdFee, | ||
bool | fDryRun = false |
||
) |
(try to) add transaction to memory pool
Definition at line 890 of file validation.cpp.
References AcceptToMemoryPoolWithTime(), GetTime(), and Params().
Referenced by CPrivateSendServer::CommitFinalTransaction(), CPrivateSendServer::ConsumeCollateral(), CPrivateSend::IsCollateralValid(), ProcessMessage(), sendrawtransaction(), UpdateMempoolForReorg(), and while().
◆ AcceptToMemoryPoolWithTime()
|
static |
◆ ActivateBestChain()
bool ActivateBestChain | ( | CValidationState & | state, |
const CChainParams & | chainparams, | ||
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.
Definition at line 3072 of file validation.cpp.
References CChainState::ActivateBestChain(), and g_chainstate.
Referenced by llmq::CChainLocksHandler::EnforceBestChainLock(), invalidateblock(), LoadChainTip(), LoadExternalBlockFile(), ProcessGetBlockData(), ProcessMessage(), reconsiderblock(), llmq::CInstantSendManager::ResolveBlockConflicts(), and ThreadImport().
◆ CalculateCurrentUsage()
uint64_t CalculateCurrentUsage | ( | ) |
Calculate the amount of disk space the block & undo files currently use.
Calculate the amount of disk space the block & undo files currently use.
Definition at line 3874 of file validation.cpp.
References LOCK.
Referenced by FindFilesToPrune(), and getblockchaininfo().
◆ CheckBlock()
bool CheckBlock | ( | const CBlock & | block, |
CValidationState & | state, | ||
const Consensus::Params & | consensusParams, | ||
bool | fCheckPOW = true , |
||
bool | fCheckMerkleRoot = true |
||
) |
Functions for validating blocks and updating the block tree.
Context-independent validity checks
Definition at line 3417 of file validation.cpp.
References BlockMerkleRoot(), CheckBlockHeader(), CheckTransaction(), CValidationState::DoS(), CBlock::fChecked, CValidationState::GetDebugMessage(), GetLegacySigOpCount(), CValidationState::GetRejectCode(), CValidationState::GetRejectReason(), GetSerializeSize(), CBlockHeader::hashMerkleRoot, CValidationState::Invalid(), MaxBlockSigOps(), MaxBlockSize(), PROTOCOL_VERSION, REJECT_INVALID, SER_NETWORK, strprintf, and CBlock::vtx.
Referenced by CChainState::AcceptBlock(), CChainState::ConnectBlock(), DeserializeAndCheckBlockTest(), PartiallyDownloadedBlock::FillBlock(), CChainState::LoadGenesisBlock(), ProcessNewBlock(), TestBlockValidity(), and CVerifyDB::VerifyDB().
◆ CheckDiskSpace()
bool CheckDiskSpace | ( | uint64_t | nAdditionalBytes = 0 | ) |
Check whether enough disk space is available for an incoming block.
Definition at line 4022 of file validation.cpp.
References _(), GetDataDir(), and nMinDiskSpace.
Referenced by AppInitMain(), FindBlockPos(), FindUndoPos(), FlushStateToDisk(), CPrivateSendClientManager::ProcessMessage(), and CPrivateSendClientSession::SendDenominate().
◆ CheckFinalTx()
bool CheckFinalTx | ( | const CTransaction & | tx, |
int | flags = -1 |
||
) |
Transaction validation functions.
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 317 of file validation.cpp.
References AssertLockHeld(), chainActive, cs_main, flags, GetAdjustedTime(), CBlockIndex::GetMedianTimePast(), CChain::Height(), IsFinalTx(), LOCKTIME_MEDIAN_TIME_PAST, and CChain::Tip().
Referenced by AcceptToMemoryPoolWorker(), CWallet::AvailableCoins(), TransactionDesc::FormatTxStatus(), CWallet::GetLegacyBalance(), getreceivedbyaccount(), getreceivedbyaddress(), CWalletTx::IsTrusted(), ListReceived(), CTxMemPool::removeForReorg(), and TransactionRecord::updateStatus().
◆ CheckSequenceLocks()
bool CheckSequenceLocks | ( | const CTransaction & | tx, |
int | flags, | ||
LockPoints * | lp = nullptr , |
||
bool | useExistingLockPoints = false |
||
) |
Check if transaction will be BIP 68 final in the next block to be created.
Simulates calling SequenceLocks() with data from the tip of the current active chain. Optionally stores in LockPoints the resulting height and time calculated and the hash of the block needed for calculation or skips the calculation and uses the LockPoints passed in for evaluation. The LockPoints should not be considered valid if CheckSequenceLocks returns false.
See consensus/consensus.h for flag definitions.
Definition at line 367 of file validation.cpp.
References AssertLockHeld(), CalculateSequenceLocks(), chainActive, CTxMemPool::cs, cs_main, error(), EvaluateSequenceLocks(), flags, CBlockIndex::GetAncestor(), LockPoints::height, LockPoints::maxInputBlock, mempool, MEMPOOL_HEIGHT, Coin::nHeight, CBlockIndex::nHeight, pcoinsTip, CBlockIndex::pprev, CTxIn::prevout, LockPoints::time, CChain::Tip(), and CTransaction::vin.
Referenced by AcceptToMemoryPoolWorker(), and CTxMemPool::removeForReorg().
◆ ComputeBlockVersion()
int32_t ComputeBlockVersion | ( | const CBlockIndex * | pindexPrev, |
const Consensus::Params & | params, | ||
bool | fCheckMasternodesUpgraded = false |
||
) |
Determine what nVersion a new block should use.
Definition at line 1874 of file validation.cpp.
References VBDeploymentInfo::check_mn_protocol, cs_main, LOCK, Consensus::MAX_VERSION_BITS_DEPLOYMENTS, THRESHOLD_LOCKED_IN, THRESHOLD_STARTED, VERSIONBITS_TOP_BITS, versionbitscache, VersionBitsDeploymentInfo, VersionBitsMask(), and VersionBitsState().
Referenced by WarningBitsConditionChecker::Condition(), BlockAssembler::CreateNewBlock(), and UpdateTip().
◆ ConvertBitsToDouble()
double ConvertBitsToDouble | ( | unsigned int | nBits | ) |
Definition at line 1083 of file validation.cpp.
Referenced by ContextualCheckBlockHeader(), and GetBlockSubsidy().
◆ DumpMempool()
bool DumpMempool | ( | ) |
Dump the mempool to disk.
Definition at line 4985 of file validation.cpp.
References CLIENT_VERSION, CTxMemPool::cs, CAutoFile::fclose(), FileCommit(), fsbridge::fopen(), CAutoFile::Get(), GetDataDir(), GetTimeMicros(), CTxMemPool::infoAll(), LOCK, LogPrintf, CTxMemPool::mapDeltas, mempool, MEMPOOL_DUMP_VERSION, MICRO, RenameOver(), and SER_DISK.
Referenced by PrepareShutdown(), and savemempool().
◆ FindForkInGlobalIndex()
CBlockIndex* FindForkInGlobalIndex | ( | const CChain & | chain, |
const CBlockLocator & | locator | ||
) |
Find the last common block between the parameter chain and a locator.
Definition at line 284 of file validation.cpp.
References CChain::Contains(), CChain::Genesis(), mapBlockIndex, and CBlockLocator::vHave.
Referenced by CWallet::CreateWalletFromFile(), and ProcessMessage().
◆ FlushStateToDisk()
void FlushStateToDisk | ( | ) |
Flush all state, indexes and buffers to disk.
Definition at line 2526 of file validation.cpp.
References FLUSH_STATE_ALWAYS, FlushStateToDisk(), and Params().
◆ FormatStateMessage()
std::string FormatStateMessage | ( | const CValidationState & | state | ) |
Convert CValidationState to a human-readable message for logging.
Definition at line 513 of file validation.cpp.
References CValidationState::GetDebugMessage(), CValidationState::GetRejectCode(), CValidationState::GetRejectReason(), and strprintf.
Referenced by CChainState::AcceptBlock(), CChainState::AcceptBlockHeader(), AcceptToMemoryPoolWorker(), CChainState::ConnectBlock(), CChainState::ConnectTip(), BlockAssembler::CreateNewBlock(), llmq::CChainLocksHandler::DoInvalidateBlock(), llmq::CChainLocksHandler::EnforceBestChainLock(), ProcessMessage(), ProcessNewBlock(), llmq::CInstantSendManager::ResolveBlockConflicts(), CChainState::RollforwardBlock(), TestBlockValidity(), ThreadImport(), and CVerifyDB::VerifyDB().
◆ GetAddressIndex()
bool GetAddressIndex | ( | uint160 | addressHash, |
int | type, | ||
std::vector< std::pair< CAddressIndexKey, CAmount > > & | addressIndex, | ||
int | start = 0 , |
||
int | end = 0 |
||
) |
Definition at line 922 of file validation.cpp.
References error(), fAddressIndex, and pblocktree.
Referenced by getaddressbalance(), getaddressdeltas(), and getaddresstxids().
◆ GetAddressUnspent()
bool GetAddressUnspent | ( | uint160 | addressHash, |
int | type, | ||
std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > & | unspentOutputs | ||
) |
Definition at line 934 of file validation.cpp.
References error(), fAddressIndex, and pblocktree.
Referenced by getaddressutxos().
◆ GetBlockFileInfo()
CBlockFileInfo* GetBlockFileInfo | ( | size_t | n | ) |
Get block file info entry for one block file.
Definition at line 4882 of file validation.cpp.
References LOCK.
Referenced by BOOST_FIXTURE_TEST_CASE().
◆ GetBlockHash()
bool GetBlockHash | ( | uint256 & | hashRet, |
int | nBlockHeight = -1 |
||
) |
Return true if hash can be found in chainActive at nBlockHeight height.
Fills hashRet with found hash, if no nBlockHeight is specified - chainActive.Height() is used.
Definition at line 1894 of file validation.cpp.
References chainActive, cs_main, CChain::Height(), LOCK, and CChain::Tip().
Referenced by llmq::CQuorumBlockProcessor::GetQuorumBlockHash(), ProcessMessage(), and CDeterministicMNManager::UpgradeDBIfNeeded().
◆ GetBlockPosFilename()
fs::path GetBlockPosFilename | ( | const CDiskBlockPos & | pos, |
const char * | prefix | ||
) |
Translation to a filesystem path.
Definition at line 4065 of file validation.cpp.
References GetDataDir(), CDiskBlockPos::nFile, prefix, and strprintf.
Referenced by OpenDiskFile(), ThreadImport(), and UnlinkPrunedFiles().
◆ GetBlockSubsidy()
CAmount GetBlockSubsidy | ( | int | nBits, |
int | nHeight, | ||
const Consensus::Params & | consensusParams, | ||
bool | fSuperblockPartOnly = false |
||
) |
Definition at line 1108 of file validation.cpp.
References COIN, ConvertBitsToDouble(), CBaseChainParams::MAIN, Consensus::Params::nBudgetPaymentsStartBlock, Consensus::Params::nHighSubsidyBlocks, Consensus::Params::nHighSubsidyFactor, Consensus::Params::nSubsidyHalvingInterval, and Params().
Referenced by CChainState::ConnectBlock(), BlockAssembler::CreateNewBlock(), getblockstats(), and CSuperblock::GetPaymentsLimit().
◆ GetMasternodePayment()
CAmount GetMasternodePayment | ( | int | nHeight, |
CAmount | blockValue, | ||
int | nReallocActivationHeight = std::numeric_limits< int >::max() |
||
) |
Definition at line 1158 of file validation.cpp.
References CChainParams::GetConsensus(), Consensus::Params::nMasternodePaymentsIncreaseBlock, Consensus::Params::nMasternodePaymentsIncreasePeriod, Consensus::Params::nSuperblockCycle, and Params().
Referenced by CMasternodePayments::GetBlockTxOuts().
◆ 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 1398 of file validation.cpp.
References cs_main, CCoinsViewCache::GetBestBlock(), LOCK, mapBlockIndex, and CBlockIndex::nHeight.
Referenced by AcceptToMemoryPoolWorker(), and CTxMemPool::check().
◆ GetSpentIndex()
bool GetSpentIndex | ( | CSpentIndexKey & | key, |
CSpentIndexValue & | value | ||
) |
Definition at line 908 of file validation.cpp.
References fSpentIndex, CTxMemPool::getSpentIndex(), mempool, and pblocktree.
Referenced by getspentinfo(), and TxToJSON().
◆ GetTimestampIndex()
bool GetTimestampIndex | ( | const unsigned int & | high, |
const unsigned int & | low, | ||
std::vector< uint256 > & | hashes | ||
) |
Definition at line 897 of file validation.cpp.
References error(), fTimestampIndex, high, low, and pblocktree.
Referenced by getblockhashes().
◆ GetTransaction()
bool GetTransaction | ( | const uint256 & | hash, |
CTransactionRef & | txOut, | ||
const Consensus::Params & | consensusParams, | ||
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)
If blockIndex is provided, the transaction is fetched from the corresponding block.
Definition at line 950 of file validation.cpp.
References AccessByTxid(), chainActive, CLIENT_VERSION, cs_main, error(), fTxIndex, CAutoFile::Get(), CTxMemPool::get(), CBlockIndex::GetBlockHash(), CBlockHeader::GetHash(), CAutoFile::IsNull(), Coin::IsSpent(), LOCK, mapBlockIndex, mempool, Coin::nHeight, CDiskTxPos::nTxOffset, OpenBlockFile(), pblocktree, pcoinsTip, ReadBlockFromDisk(), SER_DISK, base_blob< BITS >::ToString(), and CBlock::vtx.
Referenced by AcceptToMemoryPoolWorker(), BuildDMNListEntry(), llmq::CInstantSendManager::CheckCanLock(), llmq::CChainLocksHandler::Cleanup(), getblockstats(), getrawtransaction(), gettxoutproof(), llmq::CInstantSendManager::HandleNewInputLockRecoveredSig(), CGovernanceObject::IsCollateralValid(), llmq::CInstantSendManager::ProcessInstantSendLock(), and rest_tx().
◆ GetUTXOCoin()
Definition at line 439 of file validation.cpp.
References cs_main, Coin::IsSpent(), LOCK, and pcoinsTip.
Referenced by CDeterministicMNManager::BuildNewListFromBlock(), CheckProRegTx(), CheckProUpRegTx(), GetUTXOHeight(), CPrivateSend::IsCollateralValid(), masternodelist(), ThreadImport(), CDeterministicMN::ToJson(), and MasternodeList::updateDIP3List().
◆ GetUTXOConfirmations()
int GetUTXOConfirmations | ( | const COutPoint & | outpoint | ) |
Definition at line 456 of file validation.cpp.
References chainActive, cs_main, GetUTXOHeight(), CChain::Height(), LOCK, and CChain::Tip().
Referenced by BuildDMNListEntry().
◆ GetUTXOHeight()
int GetUTXOHeight | ( | const COutPoint & | outpoint | ) |
Definition at line 449 of file validation.cpp.
References GetUTXOCoin(), and Coin::nHeight.
Referenced by GetUTXOConfirmations().
◆ GuessVerificationProgress()
double GuessVerificationProgress | ( | const ChainTxData & | data, |
const CBlockIndex * | pindex | ||
) |
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
Definition at line 5035 of file validation.cpp.
References ChainTxData::dTxRate, CBlockIndex::GetBlockTime(), CBlockIndex::nChainTx, ChainTxData::nTime, and ChainTxData::nTxCount.
Referenced by getblockchaininfo(), ClientModel::getVerificationProgress(), LoadChainTip(), CWallet::ScanForWalletTransactions(), and UpdateTip().
◆ InitScriptExecutionCache()
void InitScriptExecutionCache | ( | ) |
Initializes the script-execution cache.
Definition at line 1409 of file validation.cpp.
References DEFAULT_MAX_SIG_CACHE_SIZE, gArgs, ArgsManager::GetArg(), LogPrintf, MAX_MAX_SIG_CACHE_SIZE, and scriptExecutionCache.
Referenced by AppInitMain().
◆ InvalidateBlock()
bool InvalidateBlock | ( | CValidationState & | state, |
const CChainParams & | chainparams, | ||
CBlockIndex * | pindex | ||
) |
Mark a block as invalid.
Definition at line 3180 of file validation.cpp.
References g_chainstate, and CChainState::InvalidateBlock().
Referenced by llmq::CChainLocksHandler::DoInvalidateBlock(), invalidateblock(), and llmq::CInstantSendManager::ResolveBlockConflicts().
◆ IsInitialBlockDownload()
bool IsInitialBlockDownload | ( | ) |
Check whether we are doing an initial block download (synchronizing from disk or network)
Definition at line 1219 of file validation.cpp.
References chainActive, cs_main, fImporting(), fReindex(), CBlockIndex::GetBlockTime(), GetTime(), LOCK, LogPrintf, CBlockIndex::nChainWork, nMaxTipAge, nMinimumChainWork, Params(), and CChain::Tip().
Referenced by CChainState::AcceptBlock(), CChainState::ActivateBestChain(), PeerLogicValidation::BlockChecked(), CheckForkWarningConditions(), getblockchaininfo(), getblocktemplate(), ClientModel::inInitialBlockDownload(), CDSNotificationInterface::InitializeCurrentBlockTip(), CChainState::InvalidateBlock(), IsCurrentForFeeEstimation(), NotifyHeaderTip(), ProcessHeadersMessage(), ProcessMessage(), PeerLogicValidation::SendMessages(), and UpdateTip().
◆ LoadBlockIndex()
bool LoadBlockIndex | ( | const CChainParams & | chainparams | ) |
Load the block tree and coins database from disk, initializing state if we're running with -reindex.
Definition at line 4490 of file validation.cpp.
References DEFAULT_ADDRESSINDEX, DEFAULT_SPENTINDEX, DEFAULT_TIMESTAMPINDEX, DEFAULT_TXINDEX, fAddressIndex, fReindex(), fSpentIndex, fTimestampIndex, fTxIndex, gArgs, ArgsManager::GetBoolArg(), LoadBlockIndexDB(), LogPrintf, mapBlockIndex, and pblocktree.
Referenced by AppInitMain().
◆ LoadChainTip()
bool LoadChainTip | ( | const CChainParams & | chainparams | ) |
Update the chain tip based on database information.
Definition at line 4214 of file validation.cpp.
References ActivateBestChain(), chainActive, DateTimeStrFormat(), g_chainstate, CBlockIndex::GetBlockHash(), CBlockIndex::GetBlockTime(), GuessVerificationProgress(), CChain::Height(), LogPrintf, mapBlockIndex, pcoinsTip, CChainState::PruneBlockIndexCandidates(), CChain::SetTip(), CChain::Tip(), base_blob< BITS >::ToString(), and CChainParams::TxData().
Referenced by AppInitMain().
◆ LoadExternalBlockFile()
bool LoadExternalBlockFile | ( | const CChainParams & | chainparams, |
FILE * | fileIn, | ||
CDiskBlockPos * | dbp = nullptr |
||
) |
Import blocks from an external file.
Definition at line 4576 of file validation.cpp.
References CChainState::AcceptBlock(), ActivateBestChain(), BLOCK_HAVE_DATA, CLIENT_VERSION, cs_main, CBufferedFile::eof(), CBufferedFile::FindByte(), FLATDATA, g_chainstate, CChainParams::GetConsensus(), CBufferedFile::GetPos(), GetTimeMillis(), Consensus::Params::hashGenesisBlock, CValidationState::IsError(), LOCK, LogPrint, LogPrintf, mapBlockIndex, MaxBlockSize(), CMessageHeader::MESSAGE_START_SIZE, CChainParams::MessageStart(), NotifyHeaderTip(), CDiskBlockPos::nPos, ReadBlockFromDisk(), BCLog::REINDEX, SER_DISK, CBufferedFile::SetLimit(), CBufferedFile::SetPos(), and base_blob< BITS >::ToString().
Referenced by ThreadImport().
◆ LoadGenesisBlock()
bool LoadGenesisBlock | ( | const CChainParams & | chainparams | ) |
Ensures we have a genesis block in the block tree, possibly writing one to disk.
Definition at line 4571 of file validation.cpp.
References g_chainstate, and CChainState::LoadGenesisBlock().
Referenced by AppInitMain(), and ThreadImport().
◆ LoadMempool()
bool LoadMempool | ( | ) |
Load the mempool from disk.
Definition at line 4909 of file validation.cpp.
References AcceptToMemoryPoolWithTime(), CLIENT_VERSION, count, cs_main, DEFAULT_MEMPOOL_EXPIRY, CTxMemPool::exists(), fsbridge::fopen(), gArgs, ArgsManager::GetArg(), GetDataDir(), GetTime(), CAutoFile::IsNull(), CValidationState::IsValid(), LOCK, LogPrintf, mempool, MEMPOOL_DUMP_VERSION, Params(), CTxMemPool::PrioritiseTransaction(), SER_DISK, and ShutdownRequested().
Referenced by ThreadImport().
◆ OpenBlockFile()
FILE* OpenBlockFile | ( | const CDiskBlockPos & | pos, |
bool | fReadOnly = false |
||
) |
Open a block file (blk?????.dat)
Definition at line 4056 of file validation.cpp.
References OpenDiskFile().
Referenced by FindBlockPos(), FlushBlockFile(), GetTransaction(), LoadBlockIndexDB(), ReadBlockFromDisk(), ThreadImport(), and WriteBlockToDisk().
◆ PreciousBlock()
bool PreciousBlock | ( | CValidationState & | state, |
const CChainParams & | params, | ||
CBlockIndex * | pindex | ||
) |
Mark a block as precious and reorganize.
Definition at line 3104 of file validation.cpp.
References g_chainstate, and CChainState::PreciousBlock().
Referenced by preciousblock().
◆ ProcessNewBlock()
bool ProcessNewBlock | ( | const CChainParams & | chainparams, |
const std::shared_ptr< const CBlock > | pblock, | ||
bool | fForceProcessing, | ||
bool * | fNewBlock | ||
) |
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.
Call without cs_main held.
- Parameters
-
[in] pblock The block we want to process. [in] fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers. [out] fNewBlock A boolean which is set to indicate if the block was first received via this call
- Returns
- True if state.IsValid()
Definition at line 3803 of file validation.cpp.
References CChainState::AcceptBlock(), CChainState::ActivateBestChain(), AssertLockNotHeld, CMainSignals::BlockChecked(), CheckBlock(), cs_main, error(), FormatStateMessage(), g_chainstate, CChainParams::GetConsensus(), GetMainSignals(), LOCK, LogPrintf, and NotifyHeaderTip().
Referenced by ProcessMessage(), and submitblock().
◆ ProcessNewBlockHeaders()
bool ProcessNewBlockHeaders | ( | const std::vector< CBlockHeader > & | block, |
CValidationState & | state, | ||
const CChainParams & | chainparams, | ||
const CBlockIndex ** | ppindex = nullptr , |
||
CBlockHeader * | first_invalid = nullptr |
||
) |
Process incoming block headers.
Call without cs_main held.
- Parameters
-
[in] block The block headers themselves [out] state This may be set to an Error state if any error occurred processing them [in] chainparams The params for the chain we want to connect to [out] ppindex If set, the pointer will be set to point to the last new block index object for the given headers [out] first_invalid First header that fails validation, if one exists
Definition at line 3682 of file validation.cpp.
References CChainState::AcceptBlockHeader(), cs_main, g_chainstate, LOCK, NotifyHeaderTip(), and CBlockHeader::SetNull().
Referenced by ProcessHeadersMessage(), and ProcessMessage().
◆ PruneAndFlush()
void PruneAndFlush | ( | ) |
Prune block files and flush state to disk.
Definition at line 2532 of file validation.cpp.
References FLUSH_STATE_NONE, FlushStateToDisk(), and Params().
Referenced by AppInitMain().
◆ PruneBlockFilesManual()
void PruneBlockFilesManual | ( | int | nManualPruneHeight | ) |
Prune block files up to a given height.
Definition at line 3953 of file validation.cpp.
References FLUSH_STATE_NONE, FlushStateToDisk(), and Params().
Referenced by pruneblockchain().
◆ PruneOneBlockFile()
void PruneOneBlockFile | ( | const int | fileNumber | ) |
Mark one block file as pruned.
Definition at line 3886 of file validation.cpp.
References BLOCK_HAVE_DATA, BLOCK_HAVE_UNDO, LOCK, mapBlockIndex, CBlockIndex::nDataPos, CBlockIndex::nFile, CBlockIndex::nStatus, CBlockIndex::nUndoPos, and CBlockIndex::pprev.
Referenced by BOOST_FIXTURE_TEST_CASE(), FindFilesToPrune(), and FindFilesToPruneManual().
◆ ReadBlockFromDisk() [1/2]
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CDiskBlockPos & | pos, | ||
const Consensus::Params & | consensusParams | ||
) |
Functions for disk access for blocks.
Definition at line 1043 of file validation.cpp.
References CheckProofOfWork(), CLIENT_VERSION, error(), CBlockHeader::GetHash(), CAutoFile::IsNull(), CBlockHeader::nBits, OpenBlockFile(), SER_DISK, CBlock::SetNull(), and CDiskBlockPos::ToString().
Referenced by BuildSimplifiedMNListDiff(), CChainState::ConnectTip(), CChainState::DisconnectTip(), GetBlockChecked(), llmq::CChainLocksHandler::GetBlockTxs(), getmerkleblocks(), GetTransaction(), gettxoutproof(), listsinceblock(), LoadExternalBlockFile(), CZMQPublishRawBlockNotifier::NotifyBlock(), CZMQPublishRawChainLockNotifier::NotifyChainLock(), CZMQPublishRawChainLockSigNotifier::NotifyChainLock(), ProcessGetBlockData(), ProcessMessage(), ReadBlockFromDisk(), CChainState::ReplayBlocks(), rest_block(), CChainState::RollforwardBlock(), CWallet::ScanForWalletTransactions(), PeerLogicValidation::SendMessages(), llmq::CQuorumBlockProcessor::UpgradeDB(), and CVerifyDB::VerifyDB().
◆ ReadBlockFromDisk() [2/2]
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CBlockIndex * | pindex, | ||
const Consensus::Params & | consensusParams | ||
) |
Definition at line 1067 of file validation.cpp.
References cs_main, error(), CBlockIndex::GetBlockHash(), CBlockIndex::GetBlockPos(), CBlockHeader::GetHash(), LOCK, ReadBlockFromDisk(), CDiskBlockPos::ToString(), and CBlockIndex::ToString().
◆ ReplayBlocks()
bool ReplayBlocks | ( | const CChainParams & | params, |
CCoinsView * | view | ||
) |
Replay blocks that aren't fully applied to the database.
Definition at line 4451 of file validation.cpp.
References g_chainstate, and CChainState::ReplayBlocks().
Referenced by AppInitMain().
◆ ResetBlockFailureFlags()
bool ResetBlockFailureFlags | ( | CBlockIndex * | pindex | ) |
Remove invalidity status from a block and its descendants.
Definition at line 3218 of file validation.cpp.
References g_chainstate, and CChainState::ResetBlockFailureFlags().
Referenced by llmq::CChainLocksHandler::EnforceBestChainLock(), and reconsiderblock().
◆ TestBlockValidity()
bool TestBlockValidity | ( | CValidationState & | state, |
const CChainParams & | chainparams, | ||
const CBlock & | block, | ||
CBlockIndex * | pindexPrev, | ||
bool | fCheckPOW = true , |
||
bool | fCheckMerkleRoot = 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 3837 of file validation.cpp.
References AssertLockHeld(), chainActive, llmq::chainLocksHandler, CheckBlock(), CChainState::ConnectBlock(), ContextualCheckBlock(), ContextualCheckBlockHeader(), cs_main, CValidationState::DoS(), error(), evoDb, FormatStateMessage(), g_chainstate, GetAdjustedTime(), CChainParams::GetConsensus(), CBlockHeader::GetHash(), CValidationState::IsValid(), CBlockIndex::nHeight, pcoinsTip, REJECT_INVALID, and CChain::Tip().
Referenced by BlockAssembler::CreateNewBlock(), and getblocktemplate().
◆ TestLockPointValidity()
bool TestLockPointValidity | ( | const LockPoints * | lp | ) |
Test whether the LockPoints height and time are still valid on the current chain.
Definition at line 349 of file validation.cpp.
References AssertLockHeld(), chainActive, CChain::Contains(), cs_main, and LockPoints::maxInputBlock.
Referenced by CTxMemPool::removeForReorg().
◆ ThreadScriptCheck()
void ThreadScriptCheck | ( | ) |
Run an instance of the script checking thread.
Definition at line 1866 of file validation.cpp.
References RenameThread(), and scriptcheckqueue.
Referenced by AppInitMain().
◆ UnlinkPrunedFiles()
void UnlinkPrunedFiles | ( | const std::set< int > & | setFilesToPrune | ) |
Actually unlink the specified files.
Definition at line 3920 of file validation.cpp.
References GetBlockPosFilename(), and LogPrintf.
Referenced by BOOST_FIXTURE_TEST_CASE(), and FlushStateToDisk().
◆ UnloadBlockIndex()
void UnloadBlockIndex | ( | ) |
Unload database information.
Definition at line 4464 of file validation.cpp.
References chainActive, VersionBitsCache::Clear(), CTxMemPool::clear(), cs_main, fHavePruned, g_chainstate, LOCK, mapBlockIndex, mempool, pindexBestHeader, CChain::SetTip(), CChainState::UnloadBlockIndex(), VERSIONBITS_NUM_BITS, versionbitscache, and warningcache.
Referenced by AppInitMain().
◆ UpdateCoins()
void UpdateCoins | ( | const CTransaction & | tx, |
CCoinsViewCache & | inputs, | ||
int | nHeight | ||
) |
Apply the effects of this transaction on the UTXO set represented by view.
Definition at line 1386 of file validation.cpp.
References UpdateCoins().
◆ VersionBitsTipState()
ThresholdState VersionBitsTipState | ( | const Consensus::Params & | params, |
Consensus::DeploymentPos | pos | ||
) |
Get the BIP9 state for a given deployment at the current tip.
Definition at line 4889 of file validation.cpp.
References AssertLockHeld(), chainActive, cs_main, CChain::Tip(), versionbitscache, and VersionBitsState().
Referenced by BIP9SoftForkDesc().
◆ VersionBitsTipStateSinceHeight()
int VersionBitsTipStateSinceHeight | ( | const Consensus::Params & | params, |
Consensus::DeploymentPos | pos | ||
) |
Get the block height at which the BIP9 deployment switched into the state for the block building on the current tip.
Definition at line 4901 of file validation.cpp.
References chainActive, cs_main, LOCK, CChain::Tip(), versionbitscache, and VersionBitsStateSinceHeight().
Referenced by BIP9SoftForkDesc().
◆ VersionBitsTipStatistics()
BIP9Stats VersionBitsTipStatistics | ( | const Consensus::Params & | params, |
Consensus::DeploymentPos | pos | ||
) |
Get the numerical statistics for the BIP9 state for a given deployment at the current tip.
Definition at line 4895 of file validation.cpp.
References chainActive, cs_main, LOCK, CChain::Tip(), versionbitscache, and VersionBitsStatistics().
Referenced by BIP9SoftForkDesc().
Variable Documentation
◆ BLOCK_DOWNLOAD_TIMEOUT_BASE
|
static |
Block download timeout base, expressed in millionths of the block interval (i.e.
2.5 min)
Definition at line 110 of file validation.h.
Referenced by PeerLogicValidation::SendMessages().
◆ BLOCK_DOWNLOAD_TIMEOUT_PER_PEER
|
static |
Additional block download timeout per parallel downloading peer (i.e.
1.25 min)
Definition at line 112 of file validation.h.
Referenced by PeerLogicValidation::SendMessages().
◆ BLOCK_DOWNLOAD_WINDOW
|
static |
Size of the "block download window": how far ahead of our current height do we fetch? Larger windows tolerate larger download speed differences between peer, but increase the potential degree of disordering of blocks on disk (which make reindexing and pruning harder).
We'll probably want to make this a per-peer adaptive value at some point.
Definition at line 102 of file validation.h.
◆ BLOCK_STALLING_TIMEOUT
|
static |
Timeout in seconds during which a peer must stall block download progress before being disconnected.
Definition at line 89 of file validation.h.
Referenced by PeerLogicValidation::SendMessages().
◆ BLOCKFILE_CHUNK_SIZE
|
static |
The pre-allocation chunk size for blk?????.dat files (since 0.8)
Definition at line 78 of file validation.h.
Referenced by FindBlockPos(), and FindFilesToPrune().
◆ chainActive
CChain& chainActive |
The currently-connected chain of blocks (protected by cs_main).
Definition at line 217 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), ListCoinsTestingSetup::AddTx(), AlreadyHave(), AppInitMain(), blockheaderToJSON(), BlockRequestAllowed(), blockToJSON(), CWallet::BlockUntilSyncedToCurrentChain(), BOOST_FIXTURE_TEST_CASE(), BuildSimplifiedMNListDiff(), llmq::CChainLocksHandler::CheckActiveState(), llmq::CInstantSendManager::CheckCanLock(), CheckFinalTx(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), CheckSequenceLocks(), llmq::CChainLocksHandler::Cleanup(), PeerLogicValidation::ConsiderEviction(), BlockAssembler::CreateNewBlock(), CWallet::CreateTransaction(), CreateTransactionTestSetup::CreateTransactionTestSetup(), CWallet::CreateWalletFromFile(), dumpwallet(), llmq::CChainLocksHandler::EnforceBestChainLock(), FindFilesToPrune(), FindFilesToPruneManual(), FlushStateToDisk(), TransactionDesc::FormatTxStatus(), getbestblockhash(), getblockchaininfo(), getblockcount(), GetBlockHash(), getblockhash(), getblockheaders(), getblockstats(), getblocktemplate(), CMasternodePayments::GetBlockTxOuts(), getchaintips(), getchaintxstats(), CreateTransactionTestSetup::GetCoins(), CMerkleTx::GetDepthInMainChain(), GetDifficulty(), getgovernanceinfo(), CWallet::GetKeyBirthTimes(), ClientModel::getLastBlockDate(), ClientModel::getLastBlockHash(), getmerkleblocks(), getmininginfo(), GetNetworkHashPS(), ClientModel::getNumBlocks(), getrawtransaction(), GetRequiredPaymentsStrings(), GetTransaction(), gettxoutproof(), GetUTXOConfirmations(), ClientModel::getVerificationProgress(), importelectrumwallet(), importmulti(), importprunedfunds(), importwallet(), CDSNotificationInterface::InitializeCurrentBlockTip(), InvalidChainFound(), CGovernanceObject::IsCollateralValid(), IsCurrentForFeeEstimation(), IsInitialBlockDownload(), ListCoinsTestingSetup::ListCoinsTestingSetup(), listsinceblock(), LoadChainTip(), CWallet::MarkConflicted(), masternode_winners(), masternodelist(), ParseBlock(), WalletModel::pollBalanceChanged(), llmq::CQuorumBlockProcessor::ProcessBlock(), llmq::CQuorumBlockProcessor::ProcessCommitment(), ProcessGetBlockData(), ProcessHeadersMessage(), llmq::CQuorumBlockProcessor::ProcessMessage(), ProcessMessage(), CSporkManager::ProcessSpork(), protx_list(), pruneblockchain(), quorum_dkgstatus(), quorum_list(), quorum_memberof(), llmq::CInstantSendManager::RemoveChainLockConflictingLock(), rescanblockchain(), CWallet::RescanFromTime(), rest_getutxos(), rest_headers(), CWallet::ScanForWalletTransactions(), llmq::CQuorumManager::ScanQuorums(), llmq::CSigningManager::SelectQuorumForSigning(), PeerLogicValidation::SendMessages(), TransactionRecord::statusUpdateNeeded(), TestBlockValidity(), TestLockPointValidity(), ThreadImport(), llmq::CChainLocksHandler::TrySignChainTip(), TxToJSON(), UnloadBlockIndex(), UpdateMempoolForReorg(), TransactionRecord::updateStatus(), llmq::CQuorumBlockProcessor::UpgradeDB(), CDeterministicMNManager::UpgradeDBIfNeeded(), CVerifyDB::VerifyDB(), verifytxoutproof(), VersionBitsTipState(), VersionBitsTipStateSinceHeight(), and VersionBitsTipStatistics().
◆ COINBASE_FLAGS
CScript COINBASE_FLAGS |
Constant stuff for coinbase transactions we create:
Definition at line 255 of file validation.cpp.
Referenced by getblocktemplate(), and IncrementExtraNonce().
◆ cs_main
CCriticalSection cs_main |
Definition at line 213 of file validation.cpp.
Referenced by WalletModel::abandonTransaction(), CWallet::AbandonTransaction(), abandontransaction(), CChainState::AcceptBlock(), CChainState::AcceptBlockHeader(), llmq::CChainLocksHandler::AcceptedBlockHeader(), AcceptToMemoryPoolWorker(), CChainState::ActivateBestChain(), CChainState::ActivateBestChainStep(), CGovernanceManager::AddGovernanceObject(), addmultisigaddress(), AddTx(), ListCoinsTestingSetup::AddTx(), AppInitMain(), llmq::CInstantSendManager::AskNodesForLockedTx(), CWallet::AutoBackupWallet(), CWallet::AutoLockMasternodeCollaterals(), CWallet::AvailableCoins(), backupwallet(), llmq::CSigSharesManager::BanNode(), PeerLogicValidation::BlockChecked(), PeerLogicValidation::BlockConnected(), CWallet::BlockConnected(), CWallet::BlockDisconnected(), blockheaderToJSON(), BlockRequestAllowed(), blockToJSON(), CWallet::BlockUntilSyncedToCurrentChain(), BOOST_FIXTURE_TEST_CASE(), BuildSimplifiedMNListDiff(), CalculateObjectGetDataTime(), llmq::CChainLocksHandler::CheckActiveState(), CChainState::CheckBlockIndex(), llmq::CInstantSendManager::CheckCanLock(), CheckFinalTx(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), PeerLogicValidation::CheckForStaleTipAndEvictPeers(), CheckInputs(), CheckInputsFromMempoolAndCache(), CGovernanceManager::CheckPostponedObjects(), CheckSequenceLocks(), llmq::CChainLocksHandler::Cleanup(), llmq::CSigSharesManager::CollectPendingSigSharesToVerify(), combinerawtransaction(), CPrivateSendServer::CommitFinalTransaction(), CWallet::CommitTransaction(), ComputeBlockVersion(), CChainState::ConnectBlock(), PeerLogicValidation::ConsiderEviction(), CPrivateSendServer::ConsumeCollateral(), CWallet::CountInputsWithAmount(), CWallet::CreateCollateralTransaction(), CPrivateSendClientSession::CreateDenominated(), BlockAssembler::CreateNewBlock(), CWallet::CreateTransaction(), decoderawtransaction(), TransactionTablePriv::describe(), CPrivateSendClientSession::DoAutomaticDenominating(), llmq::CChainLocksHandler::DoInvalidateBlock(), dumpprivkey(), dumpwallet(), encryptwallet(), llmq::CChainLocksHandler::EnforceBestChainLock(), EraseObjectRequest(), PeerLogicValidation::EvictExtraOutboundPeers(), PeerLogicValidation::FinalizeNode(), FindFilesToPrune(), FindFilesToPruneManual(), FlushStateToDisk(), TransactionDesc::FormatTxStatus(), CWallet::FundTransaction(), getaccount(), getaccountaddress(), getaddressesbyaccount(), CWallet::GetAnonymizedBalance(), CWallet::GetAvailableBalance(), CWallet::GetAverageAnonymizedRounds(), getbalance(), CWallet::GetBalance(), getbestblockhash(), getbestchainlock(), getblock(), getblockchaininfo(), getblockcount(), GetBlockHash(), getblockhash(), getblockheader(), getblockheaders(), GetBlockScriptFlags(), getblockstats(), getblocktemplate(), CMasternodePayments::GetBlockTxOuts(), llmq::CChainLocksHandler::GetBlockTxs(), getchaintips(), getchaintxstats(), CreateTransactionTestSetup::GetCoins(), CWallet::GetCollateralTxDSIn(), llmq::CQuorumBlockProcessor::GetCommitmentsFromBlock(), CWallet::GetDenominatedBalance(), CMerkleTx::GetDepthInMainChain(), getdifficulty(), getgovernanceinfo(), ClientModel::getHeaderTipHeight(), ClientModel::getHeaderTipTime(), CWallet::GetImmatureBalance(), CWallet::GetImmatureWatchOnlyBalance(), ClientModel::getLastBlockDate(), ClientModel::getLastBlockHash(), CWallet::GetLegacyBalance(), getmerkleblocks(), llmq::CQuorumBlockProcessor::GetMinableCommitment(), llmq::CQuorumBlockProcessor::GetMinableCommitmentTx(), getmininginfo(), getnetworkhashps(), getnetworkinfo(), getnewaddress(), GetNodeStateStats(), CWallet::GetNormalizedAnonymizedBalance(), ClientModel::getNumBlocks(), GetObjectRequestTime(), WalletModel::getOutputs(), llmq::CQuorumManager::GetQuorum(), llmq::CQuorumBlockProcessor::GetQuorumBlockHash(), getrawchangeaddress(), getrawtransaction(), getreceivedbyaccount(), getreceivedbyaddress(), GetRequestedObjectCount(), GetRequiredPaymentsStrings(), getspecialtxes(), GetSpendHeight(), GetTransaction(), gettransaction(), TransactionTablePriv::getTxHex(), gettxout(), gettxoutproof(), getunconfirmedbalance(), CWallet::GetUnconfirmedBalance(), CWallet::GetUnconfirmedWatchOnlyBalance(), GetUTXOCoin(), GetUTXOConfirmations(), GetUTXOStats(), ClientModel::getVerificationProgress(), getwalletinfo(), CWallet::GetWatchOnlyBalance(), gobject_get(), gobject_submit(), llmq::CDKGSessionHandler::HandleDKGRound(), importaddress(), importelectrumwallet(), importmulti(), importprivkey(), importprunedfunds(), importpubkey(), importwallet(), TransactionTablePriv::index(), CActiveMasternodeManager::Init(), CDSNotificationInterface::InitializeCurrentBlockTip(), PeerLogicValidation::InitializeNode(), CChainState::InvalidateBlock(), invalidateblock(), CMerkleTx::IsChainLocked(), CGovernanceObject::IsCollateralValid(), CPrivateSend::IsCollateralValid(), IsCurrentForFeeEstimation(), IsInitialBlockDownload(), WalletModel::isLockedCoin(), WalletModel::isSpent(), keypoolrefill(), listaccounts(), listaddressbalances(), listaddressgroupings(), CWallet::ListCoins(), WalletModel::listLockedCoins(), listlockunspent(), ListObjects(), WalletModel::listProTxCoins(), listreceivedbyaccount(), listreceivedbyaddress(), listsinceblock(), listtransactions(), listunspent(), LoadExternalBlockFile(), CChainState::LoadGenesisBlock(), LoadMempool(), WalletBatch::LoadWallet(), CWallet::LoadWallet(), WalletModel::lockCoin(), lockunspent(), CPrivateSendClientSession::MakeCollateralAmounts(), CWallet::MarkConflicted(), masternode_winners(), masternodelist(), movecmd(), PeerLogicValidation::NewPoWValidBlock(), CZMQPublishRawBlockNotifier::NotifyBlock(), CZMQPublishRawChainLockNotifier::NotifyChainLock(), CZMQPublishRawChainLockSigNotifier::NotifyChainLock(), NotifyHeaderTip(), ParseBlock(), WalletModel::pollBalanceChanged(), CChainState::PreciousBlock(), preciousblock(), CPrivateSendClientSession::PrepareDenominate(), PrepareShutdown(), WalletModel::prepareTransaction(), prioritisetransaction(), llmq::CQuorumBlockProcessor::ProcessBlock(), CDeterministicMNManager::ProcessBlock(), ProcessGetBlockData(), ProcessGetData(), ProcessHeadersMessage(), llmq::CInstantSendManager::ProcessInstantSendLock(), llmq::CQuorumBlockProcessor::ProcessMessage(), CMNAuth::ProcessMessage(), llmq::CDKGSessionManager::ProcessMessage(), CPrivateSendServer::ProcessMessage(), CPrivateSendClientManager::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), llmq::CInstantSendManager::ProcessMessageInstantSendLock(), llmq::CSigningManager::ProcessMessageRecoveredSig(), PeerLogicValidation::ProcessMessages(), ProcessNewBlock(), ProcessNewBlockHeaders(), llmq::CChainLocksHandler::ProcessNewChainLock(), llmq::CInstantSendManager::ProcessPendingInstantSendLocks(), llmq::ProcessPendingMessageBatch(), llmq::CSigningManager::ProcessPendingRecoveredSigs(), llmq::CSigningManager::ProcessRecoveredSig(), CSporkManager::ProcessSpork(), protx_diff(), protx_list(), pruneblockchain(), llmq::CDKGPendingMessages::PushPendingMessage(), quorum_dkgstatus(), quorum_info(), quorum_list(), quorum_memberof(), CWallet::ReacceptWalletTransactions(), ReadBlockFromDisk(), reconsiderblock(), PeerTablePriv::refreshPeers(), TransactionTablePriv::refreshWallet(), llmq::CSigSharesManager::RemoveBannedNodeStates(), llmq::CInstantSendManager::RemoveChainLockConflictingLock(), removeprunedfunds(), CChainState::ReplayBlocks(), CGovernanceManager::RequestGovernanceObjectVotes(), RequestObject(), rescanblockchain(), CWallet::RescanFromTime(), resendwallettransactions(), CChainState::ResetBlockFailureFlags(), llmq::CInstantSendManager::ResolveBlockConflicts(), rest_block(), rest_getutxos(), rest_headers(), CWallet::ScanForWalletTransactions(), llmq::CQuorumManager::ScanQuorums(), CWallet::SelectCoinsGroupedByAddresses(), llmq::CSigningManager::SelectQuorumForSigning(), SendBlockTransactions(), WalletModel::sendCoins(), sendfrom(), sendmany(), PeerLogicValidation::SendMessages(), sendrawtransaction(), SendRejectsAndCheckIfBanned(), sendtoaddress(), setaccount(), setmocktime(), settxfee(), signmessage(), signrawtransaction(), TransactionRecord::statusUpdateNeeded(), submitblock(), CPrivateSendClientSession::SubmitDenominate(), CGovernanceManager::SyncObjects(), CGovernanceManager::SyncSingleObjVotes(), SyncWithValidationInterfaceQueue(), TestBlockValidity(), TestLockPointValidity(), ThreadImport(), TransactionDesc::toHTML(), llmq::CDKGDebugSessionStatus::ToJson(), CWallet::TransactionAddedToMempool(), CWallet::TransactionCanBeAbandoned(), llmq::CChainLocksHandler::TrySignChainTip(), llmq::CQuorumBlockProcessor::UndoBlock(), UnloadBlockIndex(), WalletModel::unlockCoin(), CGovernanceManager::UpdateCachesAndClean(), CActiveMasternodeManager::UpdatedBlockTip(), MasternodeList::updateDIP3List(), UpdateLastBlockAnnounceTime(), CGovernanceObject::UpdateLocalValidity(), UpdateMempoolForReorg(), UpdateObjectRequestTime(), TransactionRecord::updateStatus(), TransactionTablePriv::updateWallet(), llmq::CQuorumBlockProcessor::UpgradeDB(), CDeterministicMNManager::UpgradeDBIfNeeded(), validateaddress(), verifychain(), CVerifyDB::VerifyDB(), verifymessage(), verifytxoutproof(), VersionBitsTipState(), VersionBitsTipStateSinceHeight(), VersionBitsTipStatistics(), walletlock(), walletpassphrase(), walletpassphrasechange(), and WalletTxToJSON().
◆ DATABASE_FLUSH_INTERVAL
|
static |
Time to wait (in seconds) between flushing chainstate to disk.
Definition at line 106 of file validation.h.
Referenced by FlushStateToDisk().
◆ DATABASE_WRITE_INTERVAL
|
static |
Time to wait (in seconds) between writing blocks/block index to disk.
Definition at line 104 of file validation.h.
Referenced by FlushStateToDisk().
◆ DEFAULT_ADDRESSINDEX
|
static |
Definition at line 123 of file validation.h.
Referenced by AppInitMain(), HelpMessage(), InitParameterInteraction(), and LoadBlockIndex().
◆ DEFAULT_ANCESTOR_LIMIT
|
static |
Default for -limitancestorcount, max number of in-mempool ancestors.
Definition at line 64 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), CWallet::CreateTransaction(), HelpMessage(), and CWallet::SelectCoins().
◆ DEFAULT_ANCESTOR_SIZE_LIMIT
|
static |
Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors.
Definition at line 66 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), CWallet::CreateTransaction(), and HelpMessage().
◆ DEFAULT_BANSCORE_THRESHOLD
|
static |
Definition at line 126 of file validation.h.
Referenced by HelpMessage(), and Misbehaving().
◆ DEFAULT_BYTES_PER_SIGOP
|
static |
Definition at line 120 of file validation.h.
Referenced by HelpMessage().
◆ DEFAULT_CHECKBLOCKS
|
static |
Definition at line 211 of file validation.h.
Referenced by AppInitMain(), HelpMessage(), and verifychain().
◆ DEFAULT_CHECKLEVEL
|
static |
Definition at line 212 of file validation.h.
Referenced by AppInitMain(), HelpMessage(), InitParameterInteraction(), and verifychain().
◆ DEFAULT_CHECKPOINTS_ENABLED
|
static |
Definition at line 121 of file validation.h.
Referenced by AppInitParameterInteraction(), and HelpMessage().
◆ DEFAULT_DESCENDANT_LIMIT
|
static |
Default for -limitdescendantcount, max number of in-mempool descendants.
Definition at line 68 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), CWallet::CreateTransaction(), HelpMessage(), and CWallet::SelectCoins().
◆ DEFAULT_DESCENDANT_SIZE_LIMIT
|
static |
Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants.
Definition at line 70 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), AppInitParameterInteraction(), CWallet::CreateTransaction(), and HelpMessage().
◆ DEFAULT_MAX_TIP_AGE
|
static |
Definition at line 114 of file validation.h.
Referenced by AppInitParameterInteraction(), and HelpMessage().
◆ DEFAULT_MEMPOOL_EXPIRY
|
static |
Default for -mempoolexpiry, expiration time for mempool transactions in hours.
Definition at line 72 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), HelpMessage(), LoadMempool(), and UpdateMempoolForReorg().
◆ DEFAULT_MIN_RELAY_TX_FEE
|
static |
Default for -minrelaytxfee, minimum relay fee for transactions.
Definition at line 56 of file validation.h.
Referenced by BOOST_FIXTURE_TEST_CASE(), and HelpMessage().
◆ DEFAULT_PEERBLOOMFILTERS
|
static |
Definition at line 138 of file validation.h.
Referenced by AppInitParameterInteraction(), and HelpMessage().
◆ DEFAULT_PERMIT_BAREMULTISIG
|
static |
Default for -permitbaremultisig.
Definition at line 119 of file validation.h.
Referenced by AppInitParameterInteraction(), and HelpMessage().
◆ DEFAULT_PERSIST_MEMPOOL
|
static |
Default for -persistmempool.
Definition at line 128 of file validation.h.
Referenced by HelpMessage(), PrepareShutdown(), and ThreadImport().
◆ DEFAULT_SCRIPTCHECK_THREADS
|
static |
-par default (number of script-checking threads, 0 = auto)
Definition at line 85 of file validation.h.
Referenced by AppInitParameterInteraction(), HelpMessage(), and OptionsModel::Init().
◆ DEFAULT_SPENTINDEX
|
static |
Definition at line 125 of file validation.h.
Referenced by AppInitMain(), HelpMessage(), InitParameterInteraction(), and LoadBlockIndex().
◆ DEFAULT_STOPATHEIGHT
|
static |
Default for -stopatheight.
Definition at line 141 of file validation.h.
Referenced by CChainState::ActivateBestChain(), and HelpMessage().
◆ DEFAULT_SYNC_MEMPOOL
|
static |
Default for -syncmempool.
Definition at line 130 of file validation.h.
Referenced by HelpMessage(), and CMasternodeSync::ProcessTick().
◆ DEFAULT_TIMESTAMPINDEX
|
static |
Definition at line 124 of file validation.h.
Referenced by AppInitMain(), HelpMessage(), InitParameterInteraction(), and LoadBlockIndex().
◆ DEFAULT_TRANSACTION_MAXFEE
◆ DEFAULT_TXINDEX
|
static |
Definition at line 122 of file validation.h.
Referenced by AppInitMain(), AppInitParameterInteraction(), HelpMessage(), and LoadBlockIndex().
◆ DEFAULT_WHITELISTFORCERELAY
|
static |
Default for -whitelistforcerelay.
Definition at line 54 of file validation.h.
Referenced by HelpMessage(), InitParameterInteraction(), and ProcessMessage().
◆ DEFAULT_WHITELISTRELAY
|
static |
Default for -whitelistrelay.
Definition at line 52 of file validation.h.
Referenced by HelpMessage(), and ProcessMessage().
◆ fAddressIndex
bool fAddressIndex |
Definition at line 226 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), AppInitMain(), CChainState::ConnectBlock(), CChainState::DisconnectBlock(), GetAddressIndex(), GetAddressUnspent(), LoadBlockIndex(), and LoadBlockIndexDB().
◆ fCheckBlockIndex
bool fCheckBlockIndex |
Definition at line 234 of file validation.cpp.
Referenced by AppInitParameterInteraction(), and CChainState::CheckBlockIndex().
◆ fCheckpointsEnabled
bool fCheckpointsEnabled |
Definition at line 235 of file validation.cpp.
Referenced by AppInitParameterInteraction(), and ContextualCheckBlockHeader().
◆ fDIP0001ActiveAtTip
std::atomic<bool> fDIP0001ActiveAtTip |
Definition at line 240 of file validation.cpp.
Referenced by BlockAssembler::BlockAssembler(), getblocktemplate(), CConnman::OutboundTargetReached(), BlockAssembler::TestPackage(), and CDSNotificationInterface::UpdatedBlockTip().
◆ feeEstimator
CBlockPolicyEstimator feeEstimator |
Definition at line 249 of file validation.cpp.
Referenced by AppInitMain(), CWallet::CreateTransaction(), CTransactionBuilder::CTransactionBuilder(), estimatefee(), estimaterawfee(), estimatesmartfee(), ParseConfirmTarget(), PrepareShutdown(), CoinControlDialog::updateLabels(), and SendCoinsDialog::updateSmartFeeLabel().
◆ fHavePruned
bool fHavePruned |
Pruning-related variables and constants.
True if any block files have ever been pruned.
Definition at line 229 of file validation.cpp.
Referenced by AppInitMain(), CChainState::CheckBlockIndex(), FlushStateToDisk(), GetBlockChecked(), LoadBlockIndexDB(), rest_block(), and UnloadBlockIndex().
◆ fImporting
std::atomic_bool fImporting |
◆ fIsBareMultisigStd
bool fIsBareMultisigStd |
Definition at line 231 of file validation.cpp.
Referenced by AppInitParameterInteraction(), and IsStandardTx().
◆ fLargeWorkForkFound
bool fLargeWorkForkFound |
Definition at line 14 of file warnings.cpp.
Referenced by GetfLargeWorkForkFound(), GetWarnings(), and SetfLargeWorkForkFound().
◆ fLargeWorkInvalidChainFound
bool fLargeWorkInvalidChainFound |
Definition at line 15 of file warnings.cpp.
Referenced by GetWarnings(), and SetfLargeWorkInvalidChainFound().
◆ fPruneMode
bool fPruneMode |
True if we're running in -prune mode.
Definition at line 230 of file validation.cpp.
Referenced by AppInitMain(), AppInitParameterInteraction(), CWallet::CreateWalletFromFile(), FindBlockPos(), FindFilesToPruneManual(), FindUndoPos(), FlushStateToDisk(), getblockchaininfo(), importaddress(), importelectrumwallet(), importprivkey(), importpubkey(), importwallet(), ProcessMessage(), pruneblockchain(), rescanblockchain(), llmq::CQuorumBlockProcessor::UpgradeDB(), and CVerifyDB::VerifyDB().
◆ fReindex
std::atomic_bool fReindex |
◆ fRequireStandard
bool fRequireStandard |
Definition at line 232 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and AppInitParameterInteraction().
◆ fSpentIndex
bool fSpentIndex |
Definition at line 228 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), AppInitMain(), CChainState::ConnectBlock(), CChainState::DisconnectBlock(), GetSpentIndex(), LoadBlockIndex(), and LoadBlockIndexDB().
◆ fTimestampIndex
bool fTimestampIndex |
Definition at line 227 of file validation.cpp.
Referenced by AppInitMain(), CChainState::ConnectBlock(), GetTimestampIndex(), LoadBlockIndex(), and LoadBlockIndexDB().
◆ fTxIndex
bool fTxIndex |
Definition at line 225 of file validation.cpp.
Referenced by AlreadyHave(), AppInitMain(), getblockstats(), getrawtransaction(), GetTransaction(), LoadBlockIndex(), LoadBlockIndexDB(), and WriteTxIndexDataForBlock().
◆ g_best_block
uint256 g_best_block |
Definition at line 221 of file validation.cpp.
Referenced by getblocktemplate(), and UpdateTip().
◆ g_best_block_cv
CConditionVariable g_best_block_cv |
Definition at line 220 of file validation.cpp.
Referenced by getblocktemplate(), OnRPCStopped(), and UpdateTip().
◆ g_best_block_mutex
CWaitableCriticalSection g_best_block_mutex |
Definition at line 219 of file validation.cpp.
Referenced by getblocktemplate(), and UpdateTip().
◆ hashAssumeValid
uint256 hashAssumeValid |
Block hash whose ancestors we will assume to have valid scripts without checking them.
Definition at line 243 of file validation.cpp.
Referenced by AppInitParameterInteraction(), and CChainState::ConnectBlock().
◆ HIGH_MAX_TX_FEE
|
static |
-maxtxfee will warn if called with a higher fee than this amount (in duffs)
Definition at line 62 of file validation.h.
Referenced by WalletInit::ParameterInteraction().
◆ HIGH_TX_FEE_PER_KB
Discourage users to set fees higher than this amount (in duffs) per kB.
Definition at line 60 of file validation.h.
Referenced by WalletInit::ParameterInteraction().
◆ mapBlockIndex
BlockMap& mapBlockIndex |
Definition at line 215 of file validation.cpp.
Referenced by AddTx(), AlreadyHave(), AppInitMain(), BuildSimplifiedMNListDiff(), llmq::CInstantSendManager::CheckCanLock(), llmq::CheckLLMQCommitment(), llmq::CChainLocksHandler::Cleanup(), CWallet::ComputeTimeSmart(), llmq::CChainLocksHandler::DoInvalidateBlock(), llmq::CChainLocksHandler::EnforceBestChainLock(), FindForkInGlobalIndex(), getbestchainlock(), getblock(), getblockheader(), getblockheaders(), getblockstats(), getblocktemplate(), llmq::CChainLocksHandler::GetBlockTxs(), getchaintips(), getchaintxstats(), CMerkleTx::GetDepthInMainChain(), CWallet::GetKeyBirthTimes(), Checkpoints::GetLastCheckpoint(), getmerkleblocks(), llmq::CQuorumManager::GetQuorum(), getrawtransaction(), getspecialtxes(), GetSpendHeight(), GetTransaction(), gettxout(), gettxoutproof(), GetUTXOStats(), llmq::CDKGSessionHandler::HandleDKGRound(), importprunedfunds(), invalidateblock(), CMerkleTx::IsChainLocked(), CGovernanceObject::IsCollateralValid(), listsinceblock(), LoadBlockIndex(), LoadBlockIndexDB(), LoadChainTip(), LoadExternalBlockFile(), CWallet::MarkConflicted(), preciousblock(), llmq::CQuorumBlockProcessor::ProcessCommitment(), ProcessGetBlockData(), ProcessHeadersMessage(), llmq::CInstantSendManager::ProcessInstantSendLock(), llmq::CQuorumBlockProcessor::ProcessMessage(), ProcessMessage(), llmq::CChainLocksHandler::ProcessNewChainLock(), PruneOneBlockFile(), reconsiderblock(), llmq::CInstantSendManager::ResolveBlockConflicts(), rest_block(), rest_headers(), PeerLogicValidation::SendMessages(), submitblock(), llmq::CDKGDebugSessionStatus::ToJson(), TxToJSON(), UnloadBlockIndex(), TransactionRecord::updateStatus(), llmq::CQuorumBlockProcessor::UpgradeDB(), verifytxoutproof(), WalletTxToJSON(), and CMainCleanup::~CMainCleanup().
◆ mapPrevBlockIndex
PrevBlockMap& mapPrevBlockIndex |
Definition at line 216 of file validation.cpp.
Referenced by llmq::CChainLocksHandler::EnforceBestChainLock().
◆ MAX_BLOCKFILE_SIZE
|
static |
The maximum size of a blk?????.dat file (since 0.8)
Definition at line 76 of file validation.h.
Referenced by BOOST_FIXTURE_TEST_CASE(), and FindBlockPos().
◆ MAX_BLOCKS_IN_TRANSIT_PER_PEER
|
static |
Number of blocks that can be requested at any given time from a single peer.
Definition at line 87 of file validation.h.
Referenced by ProcessHeadersMessage(), ProcessMessage(), and PeerLogicValidation::SendMessages().
◆ MAX_BLOCKS_TO_ANNOUNCE
|
static |
Maximum number of headers to announce when relaying blocks with headers message.
Definition at line 133 of file validation.h.
Referenced by ProcessHeadersMessage(), PeerLogicValidation::SendMessages(), and PeerLogicValidation::UpdatedBlockTip().
◆ MAX_BLOCKTXN_DEPTH
|
static |
Maximum depth of blocks we're willing to respond to GETBLOCKTXN requests for.
Definition at line 97 of file validation.h.
Referenced by ProcessMessage().
◆ MAX_CMPCTBLOCK_DEPTH
|
static |
Maximum depth of blocks we're willing to serve as compact blocks to peers when requested.
For older blocks, a regular BLOCK response will be sent.
Definition at line 95 of file validation.h.
Referenced by ProcessGetBlockData().
◆ MAX_DISCONNECTED_TX_POOL_SIZE
|
static |
Maximum kilobytes for transactions to store for processing during reorg.
Definition at line 74 of file validation.h.
Referenced by CChainState::DisconnectTip().
◆ MAX_FEE_ESTIMATION_TIP_AGE
|
static |
Maximum age of our tip in seconds for us to be considered current for fee estimation.
Definition at line 116 of file validation.h.
Referenced by IsCurrentForFeeEstimation().
◆ MAX_HEADERS_RESULTS
|
static |
Number of headers sent in one getheaders result.
We rely on the assumption that if a peer sends less than this number, we reached its tip. Changing this value is a protocol upgrade.
Definition at line 92 of file validation.h.
Referenced by getblockheaders(), getmerkleblocks(), ProcessHeadersMessage(), and ProcessMessage().
◆ MAX_REJECT_MESSAGE_LENGTH
|
static |
Maximum length of reject messages.
Definition at line 108 of file validation.h.
Referenced by PeerLogicValidation::BlockChecked(), and ProcessMessage().
◆ MAX_SCRIPTCHECK_THREADS
|
static |
Maximum number of script-checking threads allowed.
Definition at line 83 of file validation.h.
Referenced by AppInitParameterInteraction(), HelpMessage(), and OptionsDialog::OptionsDialog().
◆ MAX_UNCONNECTING_HEADERS
|
static |
Maximum number of unconnecting headers announcements before DoS score.
Definition at line 136 of file validation.h.
Referenced by ProcessHeadersMessage().
◆ maxTxFee
CAmount maxTxFee |
Absolute maximum transaction fee (in duffs) used by wallet and mempool (rejects high fee in sendrawtransaction)
Definition at line 247 of file validation.cpp.
Referenced by CPrivateSendServer::CommitFinalTransaction(), CWallet::CommitTransaction(), CTransactionBuilder::GetFee(), GetMinimumFee(), CPrivateSend::IsCollateralValid(), WalletInit::ParameterInteraction(), WalletModel::prepareTransaction(), SendCoinsDialog::processSendCoinsReturn(), CWallet::ReacceptWalletTransactions(), CWalletTx::RelayWalletTransaction(), CWallet::SelectCoinsMinConf(), and sendrawtransaction().
◆ mempool
CTxMemPool mempool |
Referenced by CWalletTx::AcceptToMemoryPool(), CChainState::ActivateBestChain(), CChainState::ActivateBestChainStep(), BlockAssembler::addPackageTxs(), AlreadyHave(), AppInitMain(), AppInitParameterInteraction(), llmq::CInstantSendManager::CheckCanLock(), CheckSequenceLocks(), llmq::CChainLocksHandler::Cleanup(), combinerawtransaction(), CPrivateSendServer::CommitFinalTransaction(), CWallet::CommitTransaction(), CChainState::ConnectTip(), CPrivateSendServer::ConsumeCollateral(), CPrivateSendClientSession::CreateDenominated(), BlockAssembler::CreateNewBlock(), CWallet::CreateTransaction(), CChainState::DisconnectTip(), CPrivateSendClientSession::DoAutomaticDenominating(), DumpMempool(), entryToJSON(), FlushStateToDisk(), CWallet::FundTransaction(), getaddressmempool(), getblocktemplate(), CMerkleTx::GetDepthInMainChain(), getmempoolancestors(), getmempooldescendants(), ClientModel::getMempoolDynamicUsage(), getmempoolentry(), ClientModel::getMempoolSize(), getmininginfo(), GetSpentIndex(), GetTransaction(), gettxout(), CPrivateSend::IsCollateralValid(), CPrivateSendBaseSession::IsValidInOuts(), LoadMempool(), CPrivateSendClientSession::MakeCollateralAmounts(), mempoolInfoToJSON(), mempoolToJSON(), PrepareShutdown(), WalletModel::prepareTransaction(), prioritisetransaction(), ProcessGetData(), ProcessMessage(), CWallet::ReacceptWalletTransactions(), llmq::CInstantSendManager::RemoveMempoolConflictsForLock(), resendwallettransactions(), CWallet::ResendWalletTransactionsBefore(), rest_getutxos(), CWallet::SelectCoinsMinConf(), WalletModel::sendCoins(), sendfrom(), sendmany(), PeerLogicValidation::SendMessages(), sendrawtransaction(), sendtoaddress(), signrawtransaction(), BlockAssembler::SkipMapTxEntry(), CPrivateSendClientSession::SubmitDenominate(), UnloadBlockIndex(), CoinControlDialog::updateLabels(), UpdateMempoolForReorg(), BlockAssembler::UpdatePackagesForAdded(), SendCoinsDialog::updateSmartFeeLabel(), UpdateTip(), llmq::CInstantSendManager::UpdateWalletTransaction(), and while().
◆ MIN_BLOCKS_TO_KEEP
|
static |
Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned.
Definition at line 207 of file validation.h.
Referenced by CChainState::AcceptBlock(), AppInitMain(), FindFilesToPrune(), FindFilesToPruneManual(), ProcessMessage(), and pruneblockchain().
◆ MIN_DISK_SPACE_FOR_BLOCK_FILES
|
static |
Definition at line 222 of file validation.h.
Referenced by AppInitParameterInteraction(), and HelpMessage().
◆ minRelayTxFee
CFeeRate minRelayTxFee |
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation)
Definition at line 246 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), AppInitParameterInteraction(), BOOST_FIXTURE_TEST_CASE(), CWallet::CreateTransaction(), getnetworkinfo(), GetRequiredFee(), mempoolInfoToJSON(), and WalletInit::ParameterInteraction().
◆ nBytesPerSigOp
unsigned int nBytesPerSigOp |
Definition at line 233 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and AppInitParameterInteraction().
◆ nCoinCacheUsage
size_t nCoinCacheUsage |
Definition at line 236 of file validation.cpp.
Referenced by AppInitMain(), FlushStateToDisk(), and CVerifyDB::VerifyDB().
◆ nLastBlockSize
uint64_t nLastBlockSize |
Definition at line 57 of file miner.cpp.
Referenced by BlockAssembler::CreateNewBlock(), and getmininginfo().
◆ nLastBlockTx
uint64_t nLastBlockTx |
Definition at line 56 of file miner.cpp.
Referenced by BlockAssembler::CreateNewBlock(), and getmininginfo().
◆ nMaxTipAge
int64_t nMaxTipAge |
If the tip is older than this (in seconds), the node is considered to be in initial block download.
Definition at line 238 of file validation.cpp.
Referenced by AppInitParameterInteraction(), IsInitialBlockDownload(), ProcessMessage(), and PeerLogicValidation::SendMessages().
◆ nMinDiskSpace
|
static |
Minimum disk space required - used in CheckDiskSpace()
Definition at line 197 of file validation.h.
Referenced by CheckDiskSpace().
◆ nMinimumChainWork
arith_uint256 nMinimumChainWork |
Minimum work we will assume exists on some valid chain.
Definition at line 244 of file validation.cpp.
Referenced by CChainState::AcceptBlock(), AppInitParameterInteraction(), CChainState::ConnectBlock(), IsInitialBlockDownload(), and ProcessHeadersMessage().
◆ NODE_NETWORK_LIMITED_MIN_BLOCKS
|
static |
Minimum blocks required to signal NODE_NETWORK_LIMITED.
Definition at line 209 of file validation.h.
Referenced by ProcessGetBlockData().
◆ nPruneTarget
uint64_t nPruneTarget |
Number of MiB of block files that we're trying to stay below.
Definition at line 237 of file validation.cpp.
Referenced by AppInitParameterInteraction(), FindFilesToPrune(), and getblockchaininfo().
◆ nScriptCheckThreads
int nScriptCheckThreads |
Definition at line 222 of file validation.cpp.
Referenced by AppInitMain(), AppInitParameterInteraction(), and CChainState::ConnectBlock().
◆ pblocktree
std::unique_ptr<CBlockTreeDB> pblocktree |
Global variable that points to the active block tree (protected by cs_main)
Definition at line 301 of file validation.cpp.
Referenced by AlreadyHave(), AppInitMain(), CChainState::ConnectBlock(), CChainState::DisconnectBlock(), FlushStateToDisk(), GetAddressIndex(), GetAddressUnspent(), GetSpentIndex(), GetTimestampIndex(), GetTransaction(), LoadBlockIndex(), LoadBlockIndexDB(), PrepareShutdown(), ThreadImport(), and WriteTxIndexDataForBlock().
◆ pcoinsdbview
std::unique_ptr<CCoinsViewDB> pcoinsdbview |
Global variable that points to the coins database (protected by cs_main)
Definition at line 299 of file validation.cpp.
Referenced by AppInitMain(), gettxoutsetinfo(), and PrepareShutdown().
◆ pcoinsTip
std::unique_ptr<CCoinsViewCache> pcoinsTip |
Global variable that points to the active CCoinsView (protected by cs_main)
Definition at line 300 of file validation.cpp.
Referenced by AcceptToMemoryPoolWithTime(), AcceptToMemoryPoolWorker(), CChainState::ActivateBestChainStep(), AlreadyHave(), AppInitMain(), CheckInputsFromMempoolAndCache(), CheckSequenceLocks(), combinerawtransaction(), CChainState::ConnectTip(), CChainState::DisconnectTip(), FlushStateToDisk(), GetTransaction(), gettxout(), gettxoutproof(), GetUTXOCoin(), CPrivateSendBaseSession::IsValidInOuts(), LimitMempoolSize(), LoadChainTip(), PrepareShutdown(), ProcessMessage(), rest_getutxos(), sendrawtransaction(), signrawtransaction(), TestBlockValidity(), TransactionDesc::toHTML(), UpdateMempoolForReorg(), UpdateTip(), verifychain(), CVerifyDB::VerifyDB(), and while().
◆ pindexBestHeader
CBlockIndex* pindexBestHeader |
Best header we've seen so far (used for getheaders queries' starting points).
Definition at line 218 of file validation.cpp.
Referenced by CChainState::AddToBlockIndex(), BlockRequestAllowed(), CChainState::ConnectBlock(), getblockchaininfo(), ClientModel::getHeaderTipHeight(), ClientModel::getHeaderTipTime(), CChainState::InvalidateBlock(), IsCurrentForFeeEstimation(), CChainState::LoadBlockIndex(), CMasternodeSync::NotifyHeaderTip(), NotifyHeaderTip(), ProcessGetBlockData(), ProcessHeadersMessage(), ProcessMessage(), PeerLogicValidation::SendMessages(), UnloadBlockIndex(), and CMasternodeSync::UpdatedBlockTip().
◆ REJECT_HIGHFEE
|
static |
Too high fee.
Can not be triggered by P2P transactions
Definition at line 486 of file validation.h.
Referenced by AcceptToMemoryPoolWorker().
◆ REJECT_INTERNAL
|
static |
Reject codes greater or equal to this can be returned by AcceptToMemPool for transactions, to signal internal conditions.
They cannot and should not be sent over the P2P network.
Definition at line 484 of file validation.h.
Referenced by PeerLogicValidation::BlockChecked(), and ProcessMessage().
◆ strMessageMagic
const std::string strMessageMagic |
Definition at line 257 of file validation.cpp.
Referenced by CSporkMessage::GetSignerKeyID(), SignVerifyMessageDialog::on_signMessageButton_SM_clicked(), SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked(), CMessageSigner::SignMessage(), signmessage(), signmessagewithprivkey(), CMessageSigner::VerifyMessage(), and verifymessage().
◆ UNDOFILE_CHUNK_SIZE
|
static |
The pre-allocation chunk size for rev?????.dat files (since 0.8)
Definition at line 80 of file validation.h.
Referenced by FindFilesToPrune(), and FindUndoPos().
◆ versionbitscache
VersionBitsCache versionbitscache |
Definition at line 1872 of file validation.cpp.
Referenced by llmq::CChainLocksHandler::CheckActiveState(), CheckCbTx(), ComputeBlockVersion(), CChainState::ConnectBlock(), ContextualCheckBlock(), BlockAssembler::CreateNewBlock(), GetBlockScriptFlags(), getblocktemplate(), CMasternodePayments::GetBlockTxOuts(), UnloadBlockIndex(), llmq::CInstantSendManager::UpdatedBlockTip(), VersionBitsTipState(), VersionBitsTipStateSinceHeight(), and VersionBitsTipStatistics().