![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include "amount.h"
#include "chain.h"
#include "coins.h"
#include "protocol.h"
#include "script/script_error.h"
#include "sync.h"
#include "versionbits.h"
#include "spentindex.h"
#include <algorithm>
#include <exception>
#include <map>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
#include <atomic>
#include <boost/unordered_map.hpp>
#include <boost/filesystem/path.hpp>
Go to the source code of this file.
Classes | |
struct | BlockHasher |
struct | CTimestampIndexIteratorKey |
struct | CTimestampIndexKey |
struct | CAddressUnspentKey |
struct | CAddressUnspentValue |
struct | CAddressIndexKey |
struct | CAddressIndexIteratorKey |
struct | CAddressIndexIteratorHeightKey |
struct | CDiskTxPos |
class | CScriptCheck |
class | CBlockFileInfo |
class | CVerifyDB |
Typedefs | |
typedef boost::unordered_map< uint256, CBlockIndex *, BlockHasher > | BlockMap |
Functions | |
bool | ProcessNewBlock (const CChainParams &chainparams, const CBlock *pblock, bool fForceProcessing, const CDiskBlockPos *dbp, bool *fNewBlock) |
bool | ProcessNewBlockHeaders (const std::vector< CBlockHeader > &block, CValidationState &state, const CChainParams &chainparams, CBlockIndex **ppindex=NULL) |
bool | CheckDiskSpace (uint64_t nAdditionalBytes=0) |
FILE * | OpenBlockFile (const CDiskBlockPos &pos, bool fReadOnly=false) |
FILE * | OpenUndoFile (const CDiskBlockPos &pos, bool fReadOnly=false) |
boost::filesystem::path | GetBlockPosFilename (const CDiskBlockPos &pos, const char *prefix) |
bool | LoadExternalBlockFile (const CChainParams &chainparams, FILE *fileIn, CDiskBlockPos *dbp=NULL) |
bool | InitBlockIndex (const CChainParams &chainparams) |
bool | LoadBlockIndex () |
void | UnloadBlockIndex () |
void | ThreadScriptCheck () |
bool | IsInitialBlockDownload () |
std::string | GetWarnings (const std::string &strFor) |
bool | GetTransaction (const uint256 &hash, CTransaction &tx, const Consensus::Params ¶ms, uint256 &hashBlock, bool fAllowSlow=false) |
bool | ActivateBestChain (CValidationState &state, const CChainParams &chainparams, const CBlock *pblock=NULL) |
double | ConvertBitsToDouble (unsigned int nBits) |
CAmount | GetBlockSubsidy (int nBits, int nHeight, const Consensus::Params &consensusParams, bool fSuperblockPartOnly=false) |
CAmount | GetMasternodePayment (int nHeight, CAmount blockValue) |
void | FindFilesToPrune (std::set< int > &setFilesToPrune, uint64_t nPruneAfterHeight) |
void | UnlinkPrunedFiles (std::set< int > &setFilesToPrune) |
CBlockIndex * | InsertBlockIndex (uint256 hash) |
void | FlushStateToDisk () |
void | PruneAndFlush () |
bool | AcceptToMemoryPool (CTxMemPool &pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool *pfMissingInputs, bool fOverrideMempoolLimit=false, bool fRejectAbsurdFee=false, bool fDryRun=false) |
bool | GetUTXOCoins (const COutPoint &outpoint, CCoins &coins) |
int | GetUTXOHeight (const COutPoint &outpoint) |
int | GetUTXOConfirmations (const COutPoint &outpoint) |
std::string | FormatStateMessage (const CValidationState &state) |
ThresholdState | VersionBitsTipState (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
unsigned int | GetLegacySigOpCount (const CTransaction &tx) |
unsigned int | GetP2SHSigOpCount (const CTransaction &tx, const CCoinsViewCache &mapInputs) |
bool | CheckInputs (const CTransaction &tx, CValidationState &state, const CCoinsViewCache &view, bool fScriptChecks, unsigned int flags, bool cacheStore, std::vector< CScriptCheck > *pvChecks=NULL) |
void | UpdateCoins (const CTransaction &tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight) |
bool | CheckTransaction (const CTransaction &tx, CValidationState &state) |
bool | IsFinalTx (const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) |
bool | CheckFinalTx (const CTransaction &tx, int flags=-1) |
bool | TestLockPointValidity (const LockPoints *lp) |
bool | SequenceLocks (const CTransaction &tx, int flags, std::vector< int > *prevHeights, const CBlockIndex &block) |
bool | CheckSequenceLocks (const CTransaction &tx, int flags, LockPoints *lp=NULL, bool useExistingLockPoints=false) |
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) |
bool | WriteBlockToDisk (const CBlock &block, CDiskBlockPos &pos, const CMessageHeader::MessageStartChars &messageStart) |
bool | ReadBlockFromDisk (CBlock &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams) |
bool | ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex, const Consensus::Params &consensusParams) |
bool | DisconnectBlock (const CBlock &block, CValidationState &state, const CBlockIndex *pindex, CCoinsViewCache &coins, bool *pfClean=NULL) |
bool | DisconnectBlocks (int blocks) |
void | ReprocessBlocks (int nBlocks) |
bool | ConnectBlock (const CBlock &block, CValidationState &state, CBlockIndex *pindex, CCoinsViewCache &coins, bool fJustCheck=false) |
bool | CheckBlockHeader (const CBlockHeader &block, CValidationState &state, bool fCheckPOW=true) |
bool | CheckBlock (const CBlock &block, CValidationState &state, bool fCheckPOW=true, bool fCheckMerkleRoot=true) |
bool | ContextualCheckBlockHeader (const CBlockHeader &block, CValidationState &state, CBlockIndex *pindexPrev) |
bool | ContextualCheckBlock (const CBlock &block, CValidationState &state, CBlockIndex *pindexPrev) |
bool | TestBlockValidity (CValidationState &state, const CChainParams &chainparams, const CBlock &block, CBlockIndex *pindexPrev, bool fCheckPOW=true, bool fCheckMerkleRoot=true) |
CBlockIndex * | FindForkInGlobalIndex (const CChain &chain, const CBlockLocator &locator) |
bool | InvalidateBlock (CValidationState &state, const Consensus::Params &consensusParams, CBlockIndex *pindex) |
bool | ReconsiderBlock (CValidationState &state, CBlockIndex *pindex) |
int | GetSpendHeight (const CCoinsViewCache &inputs) |
int32_t | ComputeBlockVersion (const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, bool fAssumeMasternodeIsUpgraded=false) |
bool | GetBlockHash (uint256 &hashRet, int nBlockHeight=-1) |
Variables | |
static const bool | DEFAULT_ALERTS = true |
static const bool | DEFAULT_WHITELISTRELAY = true |
static const bool | DEFAULT_WHITELISTFORCERELAY = true |
static const unsigned int | DEFAULT_LEGACY_MIN_RELAY_TX_FEE = 10000 |
static const unsigned int | DEFAULT_DIP0001_MIN_RELAY_TX_FEE = 1000 |
static const unsigned int | DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100 |
static const unsigned int | DEFAULT_ANCESTOR_LIMIT = 25 |
static const unsigned int | DEFAULT_ANCESTOR_SIZE_LIMIT = 101 |
static const unsigned int | DEFAULT_DESCENDANT_LIMIT = 25 |
static const unsigned int | DEFAULT_DESCENDANT_SIZE_LIMIT = 101 |
static const unsigned int | DEFAULT_MEMPOOL_EXPIRY = 72 |
static const unsigned int | MAX_BLOCKFILE_SIZE = 0x8000000 |
static const unsigned int | BLOCKFILE_CHUNK_SIZE = 0x1000000 |
static const unsigned int | UNDOFILE_CHUNK_SIZE = 0x100000 |
static const int | MAX_SCRIPTCHECK_THREADS = 16 |
static const int | DEFAULT_SCRIPTCHECK_THREADS = 0 |
static const int | MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16 |
static const unsigned int | BLOCK_STALLING_TIMEOUT = 2 |
static const unsigned int | MAX_HEADERS_RESULTS = 2000 |
static const unsigned int | BLOCK_DOWNLOAD_WINDOW = 1024 |
static const unsigned int | DATABASE_WRITE_INTERVAL = 60 * 60 |
static const unsigned int | DATABASE_FLUSH_INTERVAL = 24 * 60 * 60 |
static const unsigned int | MAX_REJECT_MESSAGE_LENGTH = 111 |
static const unsigned int | AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL = 24 * 24 * 60 |
static const unsigned int | AVG_ADDRESS_BROADCAST_INTERVAL = 30 |
static const unsigned int | AVG_INVENTORY_BROADCAST_INTERVAL = 5 |
static const int64_t | BLOCK_DOWNLOAD_TIMEOUT_BASE = 250000 |
static const int64_t | BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 125000 |
static const unsigned int | DEFAULT_LIMITFREERELAY = 15 |
static const bool | DEFAULT_RELAYPRIORITY = true |
static const bool | DEFAULT_PERMIT_BAREMULTISIG = true |
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_TESTSAFEMODE = false |
static const bool | DEFAULT_ENABLE_REPLACEMENT = false |
static const unsigned int | MAX_BLOCKS_TO_ANNOUNCE = 8 |
CScript | COINBASE_FLAGS |
CCriticalSection | cs_main |
CTxMemPool | mempool |
BlockMap | mapBlockIndex |
uint64_t | nLastBlockTx |
uint64_t | nLastBlockSize |
const std::string | strMessageMagic |
CWaitableCriticalSection | csBestBlock |
CConditionVariable | cvBlockChange |
bool | fImporting |
bool | fReindex |
int | nScriptCheckThreads |
bool | fTxIndex |
bool | fIsBareMultisigStd |
bool | fRequireStandard |
unsigned int | nBytesPerSigOp |
bool | fCheckBlockIndex |
bool | fCheckpointsEnabled |
size_t | nCoinCacheUsage |
CFeeRate | minRelayTxFee |
bool | fAlerts |
bool | fEnableReplacement |
std::map< uint256, int64_t > | mapRejectedBlocks |
static const int | DIP0001_PROTOCOL_VERSION = 70208 |
std::atomic< bool > | fDIP0001WasLockedIn |
std::atomic< bool > | fDIP0001ActiveAtTip |
uint256 | hashAssumeValid |
CBlockIndex * | pindexBestHeader |
static const uint64_t | nMinDiskSpace = 52428800 |
bool | fHavePruned |
bool | fPruneMode |
uint64_t | nPruneTarget |
static const unsigned int | MIN_BLOCKS_TO_KEEP = 288 |
static const signed int | DEFAULT_CHECKBLOCKS = MIN_BLOCKS_TO_KEEP |
static const unsigned int | DEFAULT_CHECKLEVEL = 3 |
static const uint64_t | MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024 |
CChain | chainActive |
CCoinsViewCache * | pcoinsTip |
CBlockTreeDB * | pblocktree |
VersionBitsCache | versionbitscache |
static const unsigned int | REJECT_INTERNAL = 0x100 |
static const unsigned int | REJECT_HIGHFEE = 0x100 |
static const unsigned int | REJECT_ALREADY_KNOWN = 0x101 |
static const unsigned int | REJECT_CONFLICT = 0x102 |
typedef boost::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap |
Definition at line 144 of file validation.h.
bool AcceptToMemoryPool | ( | CTxMemPool & | pool, |
CValidationState & | state, | ||
const CTransaction & | tx, | ||
bool | fLimitFree, | ||
bool * | pfMissingInputs, | ||
bool | fOverrideMempoolLimit = false , |
||
bool | fRejectAbsurdFee = false , |
||
bool | fDryRun = false |
||
) |
(try to) add transaction to memory pool
Definition at line 1014 of file validation.cpp.
Referenced by CMerkleTx::AcceptToMemoryPool(), CPrivateSendServer::ChargeFees(), CPrivateSendServer::ChargeRandomFees(), CPrivateSendServer::CommitFinalTransaction(), DisconnectTip(), CPrivateSend::IsCollateralValid(), CPrivateSendServer::ProcessMessage(), ProcessMessage(), CPrivateSendClient::SendDenominate(), and sendrawtransaction().
bool ActivateBestChain | ( | CValidationState & | state, |
const CChainParams & | chainparams, | ||
const CBlock * | pblock | ||
) |
Find the best known block, and make it the tip of the block chain
Make the best chain active, in multiple steps. The result is either failure or an activated best chain. pblock is either NULL or a pointer to a block that is already loaded (to avoid loading it again from disk).
Definition at line 2808 of file validation.cpp.
Referenced by InitBlockIndex(), invalidateblock(), LoadExternalBlockFile(), ProcessNewBlock(), reconsiderblock(), ReprocessBlocks(), and ThreadImport().
bool CheckBlock | ( | const CBlock & | block, |
CValidationState & | state, | ||
bool | fCheckPOW = true , |
||
bool | fCheckMerkleRoot = true |
||
) |
Definition at line 3119 of file validation.cpp.
Referenced by AcceptBlock(), ConnectBlock(), TestBlockValidity(), and CVerifyDB::VerifyDB().
bool CheckBlockHeader | ( | const CBlockHeader & | block, |
CValidationState & | state, | ||
bool | fCheckPOW = true |
||
) |
Context-independent validity checks
Definition at line 3104 of file validation.cpp.
Referenced by AcceptBlockHeader(), and CheckBlock().
bool CheckDiskSpace | ( | uint64_t | nAdditionalBytes = 0 | ) |
Check whether enough disk space is available for an incoming block
Definition at line 3642 of file validation.cpp.
Referenced by AppInit2(), FindBlockPos(), FindUndoPos(), FlushStateToDisk(), and CPrivateSendClient::SendDenominate().
bool CheckFinalTx | ( | const CTransaction & | 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 213 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), CWallet::AvailableCoins(), TransactionDesc::FormatTxStatus(), GetAccountBalance(), CWallet::GetAddressBalances(), getbalance(), getreceivedbyaccount(), getreceivedbyaddress(), CWalletTx::IsTrusted(), CTxLockRequest::IsValid(), ListReceived(), CTxMemPool::removeForReorg(), and TransactionRecord::updateStatus().
bool CheckInputs | ( | const CTransaction & | tx, |
CValidationState & | state, | ||
const CCoinsViewCache & | view, | ||
bool | fScriptChecks, | ||
unsigned int | flags, | ||
bool | cacheStore, | ||
std::vector< CScriptCheck > * | pvChecks = NULL |
||
) |
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 NULL, script checks are pushed onto it instead of being performed inline.
Definition at line 1528 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::check(), and ConnectBlock().
bool CheckSequenceLocks | ( | const CTransaction & | tx, |
int | flags, | ||
LockPoints * | lp = NULL , |
||
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 346 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and CTxMemPool::removeForReorg().
bool CheckTransaction | ( | const CTransaction & | tx, |
CValidationState & | state | ||
) |
Context-independent validity checks
Definition at line 470 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), CheckBlock(), and ReadKeyValue().
int32_t ComputeBlockVersion | ( | const CBlockIndex * | pindexPrev, |
const Consensus::Params & | params, | ||
bool | fAssumeMasternodeIsUpgraded = false |
||
) |
Determine what nVersion a new block should use.
Definition at line 1878 of file validation.cpp.
Referenced by WarningBitsConditionChecker::Condition(), CreateNewBlock(), and UpdateTip().
bool ConnectBlock | ( | const CBlock & | block, |
CValidationState & | state, | ||
CBlockIndex * | pindex, | ||
CCoinsViewCache & | coins, | ||
bool | fJustCheck = false |
||
) |
Apply the effects of this block (with given index) on the UTXO set represented by coins
Definition at line 1956 of file validation.cpp.
Referenced by ConnectTip(), TestBlockValidity(), and CVerifyDB::VerifyDB().
bool ContextualCheckBlock | ( | const CBlock & | block, |
CValidationState & | state, | ||
CBlockIndex * | pindexPrev | ||
) |
Definition at line 3275 of file validation.cpp.
Referenced by AcceptBlock(), and TestBlockValidity().
bool ContextualCheckBlockHeader | ( | const CBlockHeader & | block, |
CValidationState & | state, | ||
CBlockIndex * | pindexPrev | ||
) |
Context-dependent validity checks
Definition at line 3232 of file validation.cpp.
Referenced by AcceptBlockHeader(), and TestBlockValidity().
double ConvertBitsToDouble | ( | unsigned int | nBits | ) |
Definition at line 1205 of file validation.cpp.
Referenced by ContextualCheckBlockHeader(), and GetBlockSubsidy().
bool DisconnectBlock | ( | const CBlock & | block, |
CValidationState & | state, | ||
const CBlockIndex * | pindex, | ||
CCoinsViewCache & | coins, | ||
bool * | pfClean = NULL |
||
) |
Functions for validating blocks and updating the block tree Undo the effects of this block (with given index) on the UTXO set represented by coins. In case pfClean is provided, operation will try to be tolerant about errors, and *pfClean will be true if no problems were found. Otherwise, the return value will be false in case of problems. Note that in any case, coins may be modified.
Definition at line 1696 of file validation.cpp.
Referenced by DisconnectTip(), and CVerifyDB::VerifyDB().
bool DisconnectBlocks | ( | int | blocks | ) |
Reprocess a number of blocks to try and get on the correct chain again
Definition at line 2591 of file validation.cpp.
Referenced by ReprocessBlocks().
void FindFilesToPrune | ( | std::set< int > & | setFilesToPrune, |
uint64_t | nPruneAfterHeight | ||
) |
Prune block and undo files (blk???.dat and undo???.dat) so that the disk space used is less than a user-defined target. The user sets the target (in MB) on the command line or in config file. This will be run on startup and whenever new space is allocated in a block or undo file, staying below the target. Changing back to unpruned requires a reindex (which in this case means the blockchain must be re-downloaded.)
Pruning functions are called from FlushStateToDisk when the global fCheckForPruning flag has been set. Block and undo files are deleted in lock-step (when blk00003.dat is deleted, so is rev00003.dat.) Pruning cannot take place until the longest chain is at least a certain length (100000 on mainnet, 1000 on testnet, 1000 on regtest). Pruning will never delete a block within a defined distance (currently 288) from the active chain's tip. The block index is updated by unsetting HAVE_DATA and HAVE_UNDO for any blocks that were stored in the deleted files. A db flag records the fact that at least some block files have been pruned.
[out] | setFilesToPrune | The set of file indices that can be unlinked will be returned |
Definition at line 3595 of file validation.cpp.
Referenced by FlushStateToDisk().
CBlockIndex* FindForkInGlobalIndex | ( | const CChain & | chain, |
const CBlockLocator & | locator | ||
) |
Find the last common block between the parameter chain and a locator.
Definition at line 172 of file validation.cpp.
Referenced by AppInit2(), and ProcessMessage().
void FlushStateToDisk | ( | ) |
Flush all state, indexes and buffers to disk.
Definition at line 2408 of file validation.cpp.
std::string FormatStateMessage | ( | const CValidationState & | state | ) |
Convert CValidationState to a human-readable message for logging
Definition at line 541 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), CheckBlock(), ConnectBlock(), CreateNewBlock(), and ProcessMessage().
bool GetAddressIndex | ( | uint160 | addressHash, |
int | type, | ||
std::vector< std::pair< CAddressIndexKey, CAmount > > & | addressIndex, | ||
int | start = 0 , |
||
int | end = 0 |
||
) |
Definition at line 1055 of file validation.cpp.
Referenced by getaddressbalance(), getaddressdeltas(), and getaddresstxids().
bool GetAddressUnspent | ( | uint160 | addressHash, |
int | type, | ||
std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > & | unspentOutputs | ||
) |
Definition at line 1067 of file validation.cpp.
Referenced by getaddressutxos().
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 1911 of file validation.cpp.
Referenced by CMasternodePayments::AddPaymentVote(), CMasternodeMan::GetMasternodeByRank(), CMasternodeMan::GetMasternodeRank(), CMasternodeMan::GetMasternodeRanks(), CMasternodeMan::GetNextMasternodeInQueueForPayment(), ProcessMessage(), CMasternodeMan::ProcessVerifyBroadcast(), CMasternodeMan::ProcessVerifyReply(), CMasternodePayments::RequestLowDataPaymentBlocks(), and CMasternodeMan::SendVerifyReply().
boost::filesystem::path GetBlockPosFilename | ( | const CDiskBlockPos & | pos, |
const char * | prefix | ||
) |
Translation to a filesystem path
Definition at line 3684 of file validation.cpp.
Referenced by OpenDiskFile(), ThreadImport(), and UnlinkPrunedFiles().
CAmount GetBlockSubsidy | ( | int | nBits, |
int | nHeight, | ||
const Consensus::Params & | consensusParams, | ||
bool | fSuperblockPartOnly = false |
||
) |
Definition at line 1230 of file validation.cpp.
Referenced by ConnectBlock(), CreateNewBlock(), and CSuperblock::GetPaymentsLimit().
unsigned int GetLegacySigOpCount | ( | const CTransaction & | tx | ) |
Count ECDSA signature operations the old-fashioned (pre-0.6) way
Definition at line 417 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), CheckBlock(), ConnectBlock(), ContextualCheckBlock(), and CreateNewBlock().
Definition at line 1276 of file validation.cpp.
Referenced by CMasternodePayments::FillBlockPayee(), CMasternodeBlockPayees::IsTransactionValid(), and CMasternode::UpdateLastPaid().
unsigned int GetP2SHSigOpCount | ( | const CTransaction & | tx, |
const CCoinsViewCache & | mapInputs | ||
) |
Count ECDSA signature operations in pay-to-script-hash inputs.
[in] | mapInputs | Map of previous transactions that have outputs we're spending |
Definition at line 431 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and ConnectBlock().
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 1475 of file validation.cpp.
Referenced by CheckInputs().
bool GetSpentIndex | ( | CSpentIndexKey & | key, |
CSpentIndexValue & | value | ||
) |
Definition at line 1041 of file validation.cpp.
Referenced by getspentinfo(), and TxToJSON().
bool GetTimestampIndex | ( | const unsigned int & | high, |
const unsigned int & | low, | ||
std::vector< uint256 > & | hashes | ||
) |
Definition at line 1030 of file validation.cpp.
Referenced by getblockhashes().
bool GetTransaction | ( | const uint256 & | hash, |
CTransaction & | txOut, | ||
const Consensus::Params & | consensusParams, | ||
uint256 & | hashBlock, | ||
bool | fAllowSlow | ||
) |
Retrieve a transaction (from memory pool, or from disk, if possible)
Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock
Definition at line 1080 of file validation.cpp.
Referenced by CMasternodeBroadcast::CheckOutpoint(), getrawtransaction(), gettxoutproof(), CGovernanceObject::IsCollateralValid(), CMasternode::IsInputAssociatedWithPubkey(), CInstantSend::ResolveConflicts(), and rest_tx().
Definition at line 446 of file validation.cpp.
Referenced by CMasternode::CheckCollateral(), GetUTXOHeight(), CPrivateSend::IsCollateralValid(), CTxLockRequest::IsValid(), CTxLockVote::IsValid(), CPrivateSendServer::ProcessMessage(), and CInstantSend::ResolveConflicts().
int GetUTXOConfirmations | ( | const COutPoint & | outpoint | ) |
Definition at line 461 of file validation.cpp.
Referenced by CMasternodeMan::GetNextMasternodeInQueueForPayment(), and CActiveMasternode::ManageStateLocal().
int GetUTXOHeight | ( | const COutPoint & | outpoint | ) |
Definition at line 454 of file validation.cpp.
Referenced by GetUTXOConfirmations(), CActiveMasternode::ManageStateLocal(), and CInstantSend::Vote().
std::string GetWarnings | ( | const std::string & | strFor | ) |
Format a string that describes several potential problems detected by the core. strFor can have three values:
Definition at line 4313 of file validation.cpp.
Referenced by getinfo(), getmininginfo(), getnetworkinfo(), ClientModel::getStatusBarWarnings(), and OnRPCPreCommand().
bool InitBlockIndex | ( | const CChainParams & | chainparams | ) |
Initialize a new block tree database + block data on disk
Definition at line 3956 of file validation.cpp.
Referenced by AppInit2(), and ThreadImport().
CBlockIndex* InsertBlockIndex | ( | uint256 | hash | ) |
Create a new block index entry for a given block hash
Definition at line 3689 of file validation.cpp.
Referenced by CBlockTreeDB::LoadBlockIndexGuts().
bool InvalidateBlock | ( | CValidationState & | state, |
const Consensus::Params & | consensusParams, | ||
CBlockIndex * | pindex | ||
) |
Mark a block as invalid.
Definition at line 2863 of file validation.cpp.
Referenced by invalidateblock().
bool IsFinalTx | ( | const CTransaction & | tx, |
int | nBlockHeight, | ||
int64_t | nBlockTime | ||
) |
Check if transaction is final and can be included in a block with the specified height and time. Consensus critical.
Definition at line 200 of file validation.cpp.
Referenced by CheckFinalTx(), ContextualCheckBlock(), and CreateNewBlock().
bool IsInitialBlockDownload | ( | ) |
Check whether we are doing an initial block download (synchronizing from disk or network)
Definition at line 1297 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), ActivateBestChain(), BitcoinMiner(), CheckForkWarningConditions(), ConnectTip(), getblocktemplate(), ClientModel::inInitialBlockDownload(), CDSNotificationInterface::InitializeCurrentBlockTip(), InvalidateBlock(), NotifyHeaderTip(), ProcessMessage(), SendMessages(), and UpdateTip().
bool LoadBlockIndex | ( | ) |
Load the block tree and coins database from disk
Definition at line 3948 of file validation.cpp.
Referenced by AppInit2().
bool LoadExternalBlockFile | ( | const CChainParams & | chainparams, |
FILE * | fileIn, | ||
CDiskBlockPos * | dbp = NULL |
||
) |
Import blocks from an external file
Definition at line 4008 of file validation.cpp.
Referenced by ThreadImport().
FILE* OpenBlockFile | ( | const CDiskBlockPos & | pos, |
bool | fReadOnly = false |
||
) |
Open a block file (blk?????.dat)
Definition at line 3676 of file validation.cpp.
Referenced by FindBlockPos(), FlushBlockFile(), GetTransaction(), LoadBlockIndexDB(), ReadBlockFromDisk(), ThreadImport(), and WriteBlockToDisk().
FILE* OpenUndoFile | ( | const CDiskBlockPos & | pos, |
bool | fReadOnly = false |
||
) |
Open an undo file (rev?????.dat)
Definition at line 3680 of file validation.cpp.
Referenced by FindUndoPos(), and FlushBlockFile().
bool ProcessNewBlock | ( | const CChainParams & | chainparams, |
const CBlock * | pblock, | ||
bool | fForceProcessing, | ||
const CDiskBlockPos * | dbp, | ||
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.
[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] | dbp | The already known disk position of pblock, or NULL if not yet stored. |
[out] | fNewBlock | A boolean which is set to indicate if the block was first received via this call |
Definition at line 3484 of file validation.cpp.
Referenced by generate(), ProcessBlockFound(), ProcessMessage(), and submitblock().
bool ProcessNewBlockHeaders | ( | const std::vector< CBlockHeader > & | block, |
CValidationState & | state, | ||
const CChainParams & | chainparams, | ||
CBlockIndex ** | ppindex = NULL |
||
) |
Process incoming block headers.
[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 |
Definition at line 3385 of file validation.cpp.
Referenced by ProcessMessage().
void PruneAndFlush | ( | ) |
Prune block files and flush state to disk.
Definition at line 2413 of file validation.cpp.
Referenced by AppInit2().
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CDiskBlockPos & | pos, | ||
const Consensus::Params & | consensusParams | ||
) |
Definition at line 1171 of file validation.cpp.
Referenced by ConnectTip(), DisconnectTip(), getblock(), GetTransaction(), gettxoutproof(), LoadExternalBlockFile(), CZMQPublishRawBlockNotifier::NotifyBlock(), ProcessGetData(), ReadBlockFromDisk(), rest_block(), CWallet::ScanForWalletTransactions(), CMasternode::UpdateLastPaid(), and CVerifyDB::VerifyDB().
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CBlockIndex * | pindex, | ||
const Consensus::Params & | consensusParams | ||
) |
Definition at line 1195 of file validation.cpp.
bool ReconsiderBlock | ( | CValidationState & | state, |
CBlockIndex * | pindex | ||
) |
Remove invalidity status from a block and its descendants.
Definition at line 2903 of file validation.cpp.
Referenced by reconsiderblock(), and ReprocessBlocks().
void ReprocessBlocks | ( | int | nBlocks | ) |
Definition at line 2608 of file validation.cpp.
Referenced by CSporkManager::ExecuteSpork().
bool SequenceLocks | ( | const CTransaction & | tx, |
int | flags, | ||
std::vector< int > * | prevHeights, | ||
const CBlockIndex & | block | ||
) |
Check if transaction is final per BIP 68 sequence numbers and can be included in a block. Consensus critical. Takes as input a list of heights at which tx's inputs (in order) confirmed.
Definition at line 323 of file validation.cpp.
Referenced by ConnectBlock().
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 3511 of file validation.cpp.
Referenced by CreateNewBlock(), and getblocktemplate().
bool TestLockPointValidity | ( | const LockPoints * | lp | ) |
Test whether the LockPoints height and time are still valid on the current chain
Definition at line 328 of file validation.cpp.
Referenced by CTxMemPool::removeForReorg().
void ThreadScriptCheck | ( | ) |
Run an instance of the script checking thread
Definition at line 1870 of file validation.cpp.
Referenced by AppInit2().
void UnlinkPrunedFiles | ( | std::set< int > & | setFilesToPrune | ) |
Actually unlink the specified files
Definition at line 3584 of file validation.cpp.
Referenced by FlushStateToDisk().
void UnloadBlockIndex | ( | ) |
Unload database information
Definition at line 3922 of file validation.cpp.
Referenced by AppInit2().
void UpdateCoins | ( | const CTransaction & | tx, |
CValidationState & | state, | ||
CCoinsViewCache & | inputs, | ||
int | nHeight | ||
) |
Apply the effects of this transaction on the UTXO set represented by view
Definition at line 1461 of file validation.cpp.
ThresholdState VersionBitsTipState | ( | const Consensus::Params & | params, |
Consensus::DeploymentPos | pos | ||
) |
Get the BIP9 state for a given deployment at the current tip.
Definition at line 4375 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and BIP9SoftForkDesc().
bool WriteBlockToDisk | ( | const CBlock & | block, |
CDiskBlockPos & | pos, | ||
const CMessageHeader::MessageStartChars & | messageStart | ||
) |
Functions for disk access for blocks
Definition at line 1150 of file validation.cpp.
Referenced by AcceptBlock(), and InitBlockIndex().
|
static |
Average delay between peer address broadcasts in seconds.
Definition at line 107 of file validation.h.
Referenced by SendMessages().
|
static |
Average delay between trickled inventory broadcasts in seconds. Blocks, whitelisted receivers, and a random 25% of transactions bypass this.
Definition at line 110 of file validation.h.
Referenced by SendMessages().
|
static |
Average delay between local address broadcasts in seconds.
Definition at line 105 of file validation.h.
Referenced by SendMessages().
|
static |
Block download timeout base, expressed in millionths of the block interval (i.e. 2.5 min)
Definition at line 112 of file validation.h.
Referenced by SendMessages().
|
static |
Additional block download timeout per parallel downloading peer (i.e. 1.25 min)
Definition at line 114 of file validation.h.
Referenced by SendMessages().
|
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 in the future perhaps pruning harder). We'll probably want to make this a per-peer adaptive value at some point.
Definition at line 97 of file validation.h.
|
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 SendMessages().
|
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().
CChain chainActive |
The currently-connected chain of blocks (protected by cs_main).
Definition at line 65 of file validation.cpp.
Referenced by AcceptBlock(), AcceptToMemoryPoolWorker(), ActivateBestChain(), ActivateBestChainStep(), AlreadyHave(), AppInit2(), BitcoinMiner(), blockheaderToJSON(), blockToJSON(), CMasternode::Check(), CMasternodePing::CheckAndUpdate(), CheckBlockIndex(), CheckFinalTx(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), CMasternodeBroadcast::CheckOutpoint(), CheckSequenceLocks(), CMasternodePing::CMasternodePing(), ConnectTip(), CreateNewBlock(), CWallet::CreateTransaction(), DisconnectTip(), dumpwallet(), FindFilesToPrune(), FindMostWorkChain(), FlushStateToDisk(), TransactionDesc::FormatTxStatus(), generate(), getbestblockhash(), getblockchaininfo(), getblockcount(), getblockhash(), GetBlockHash(), getblockheaders(), getblocktemplate(), getchaintips(), CMerkleTx::GetDepthInMainChain(), GetDifficulty(), getgovernanceinfo(), getinfo(), CWallet::GetKeyBirthTimes(), ClientModel::getLastBlockDate(), getmininginfo(), GetNetworkHashPS(), ClientModel::getNumBlocks(), GetTransaction(), gettxoutproof(), GetUTXOConfirmations(), ClientModel::getVerificationProgress(), importaddress(), importelectrumwallet(), importprivkey(), importpubkey(), importwallet(), InitBlockIndex(), CDSNotificationInterface::InitializeCurrentBlockTip(), InvalidateBlock(), InvalidChainFound(), CGovernanceObject::IsCollateralValid(), IsInitialBlockDownload(), CTxLockRequest::IsValid(), listsinceblock(), LoadBlockIndexDB(), CActiveMasternode::ManageStateLocal(), CWallet::MarkConflicted(), masternode(), masternodelist(), mempoolToJSON(), WalletModel::pollBalanceChanged(), ProcessBlockFound(), ProcessGetData(), ProcessMessage(), CSporkManager::ProcessSpork(), PruneBlockIndexCandidates(), ReceivedBlockTransactions(), ReconsiderBlock(), CMasternodePayments::RequestLowDataPaymentBlocks(), rest_getutxos(), rest_headers(), CWallet::ScanForWalletTransactions(), SendMessages(), CMerkleTx::SetMerkleBranch(), TransactionRecord::statusUpdateNeeded(), TestBlockValidity(), TestLockPointValidity(), TxToJSON(), UnloadBlockIndex(), TransactionRecord::updateStatus(), UpdateTip(), CVerifyDB::VerifyDB(), verifytxoutproof(), and VersionBitsTipState().
CScript COINBASE_FLAGS |
Constant stuff for coinbase transactions we create:
Definition at line 107 of file validation.cpp.
Referenced by getblocktemplate(), and IncrementExtraNonce().
CCriticalSection cs_main |
Global state
Definition at line 62 of file validation.cpp.
Referenced by WalletModel::abandonTransaction(), CWallet::AbandonTransaction(), abandontransaction(), AcceptBlock(), AcceptBlockHeader(), AcceptToMemoryPoolWorker(), ActivateBestChain(), ActivateBestChainStep(), CGovernanceManager::AddGovernanceObject(), addmultisigaddress(), AppInit2(), AutoBackupWallet(), CWallet::AvailableCoins(), backupwallet(), PeerLogicValidation::BlockChecked(), CPrivateSendServer::ChargeFees(), CPrivateSendServer::ChargeRandomFees(), CMasternode::Check(), CMasternodeMan::CheckAndRemove(), CMasternodePing::CheckAndUpdate(), CheckBlock(), CheckBlockIndex(), CMasternode::CheckCollateral(), CheckFinalTx(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), CGovernanceManager::CheckMasternodeOrphanObjects(), CGovernanceManager::CheckMasternodeOrphanVotes(), CMasternodeMan::CheckMnbAndUpdateMasternodeList(), CMasternodeBroadcast::CheckOutpoint(), CGovernanceManager::CheckPostponedObjects(), CheckSequenceLocks(), CMasternodePing::CMasternodePing(), CPrivateSendServer::CommitFinalTransaction(), CWallet::CommitTransaction(), ComputeBlockVersion(), ConnectBlock(), CWallet::CountInputsWithAmount(), CPrivateSendClient::CreateDenominated(), CreateNewBlock(), createrawtransaction(), CWallet::CreateTransaction(), decoderawtransaction(), TransactionTablePriv::describe(), DisconnectBlocks(), CMasternodeMan::DoFullVerificationStep(), dumpprivkey(), dumpwallet(), encryptwallet(), FindFilesToPrune(), FlushStateToDisk(), TransactionDesc::FormatTxStatus(), generate(), getaccount(), getaccountaddress(), getaddressesbyaccount(), CWallet::GetAllReserveKeys(), CWallet::GetAnonymizedBalance(), CWallet::GetAverageAnonymizedRounds(), getbalance(), CWallet::GetBalance(), getbestblockhash(), getblock(), getblockchaininfo(), getblockcount(), getblockhash(), GetBlockHash(), getblockheader(), getblockheaders(), getblocktemplate(), getchaintips(), CWallet::GetDenominatedBalance(), CMerkleTx::GetDepthInMainChain(), getdifficulty(), getgenerate(), getgovernanceinfo(), ClientModel::getHeaderTipHeight(), ClientModel::getHeaderTipTime(), CWallet::GetImmatureBalance(), CWallet::GetImmatureWatchOnlyBalance(), getinfo(), ClientModel::getLastBlockDate(), getmininginfo(), getnetworkhashps(), getnetworkinfo(), getnewaddress(), CMasternodeMan::GetNextMasternodeInQueueForPayment(), GetNodeStateStats(), CWallet::GetNormalizedAnonymizedBalance(), ClientModel::getNumBlocks(), WalletModel::getOutputs(), getrawchangeaddress(), getrawtransaction(), getreceivedbyaccount(), getreceivedbyaddress(), GetSpendHeight(), CCoinsViewDB::GetStats(), GetTransaction(), gettransaction(), TransactionTablePriv::getTxHex(), gettxout(), gettxoutproof(), getunconfirmedbalance(), CWallet::GetUnconfirmedBalance(), CWallet::GetUnconfirmedWatchOnlyBalance(), GetUTXOCoins(), GetUTXOConfirmations(), ClientModel::getVerificationProgress(), getwalletinfo(), CWallet::GetWatchOnlyBalance(), gobject(), importaddress(), importelectrumwallet(), importprivkey(), importpubkey(), importwallet(), TransactionTablePriv::index(), InitBlockIndex(), CDSNotificationInterface::InitializeCurrentBlockTip(), instantsendtoaddress(), invalidateblock(), InvalidateBlock(), CGovernanceObject::IsCollateralValid(), CPrivateSend::IsCollateralValid(), CInstantSend::IsEnoughOrphanVotesForTxAndOutPoint(), IsInitialBlockDownload(), WalletModel::isLockedCoin(), WalletModel::isSpent(), CTxLockRequest::IsValid(), keypoolrefill(), listaccounts(), listaddressgroupings(), WalletModel::listCoins(), WalletModel::listLockedCoins(), listlockunspent(), listreceivedbyaccount(), listreceivedbyaddress(), listsinceblock(), listtransactions(), listunspent(), LoadExternalBlockFile(), CWallet::LoadWallet(), WalletModel::lockCoin(), lockunspent(), CPrivateSendClient::MakeCollateralAmounts(), CActiveMasternode::ManageStateLocal(), CWallet::MarkConflicted(), masternode(), masternodelist(), movecmd(), CZMQPublishRawBlockNotifier::NotifyBlock(), NotifyHeaderTip(), WalletModel::pollBalanceChanged(), PrepareShutdown(), WalletModel::prepareTransaction(), prioritisetransaction(), ProcessBlockFound(), ProcessGetData(), CPrivateSendServer::ProcessMessage(), CInstantSend::ProcessMessage(), CMasternodeMan::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), ProcessNewBlock(), ProcessNewBlockHeaders(), CInstantSend::ProcessOrphanTxLockVotes(), CSporkManager::ProcessSpork(), CInstantSend::ProcessTxLockRequest(), CInstantSend::ProcessTxLockVote(), CWallet::ReacceptWalletTransactions(), reconsiderblock(), ReconsiderBlock(), PeerTablePriv::refreshPeers(), TransactionTablePriv::refreshWallet(), ReprocessBlocks(), CGovernanceManager::RequestGovernanceObjectVotes(), CMasternodePayments::RequestLowDataPaymentBlocks(), resendwallettransactions(), CInstantSend::ResolveConflicts(), rest_block(), rest_getutxos(), rest_headers(), CWallet::ScanForWalletTransactions(), CWallet::SelectCoinsGrouppedByAddresses(), WalletModel::sendCoins(), CPrivateSendClient::SendDenominate(), sendfrom(), sendmany(), SendMessages(), sendrawtransaction(), sendtoaddress(), setaccount(), CMerkleTx::SetMerkleBranch(), setmocktime(), settxfee(), signmessage(), signrawtransaction(), CMasternodePing::SimpleCheck(), TransactionRecord::statusUpdateNeeded(), submitblock(), CGovernanceManager::Sync(), CInstantSend::SyncTransaction(), CPrivateSend::SyncTransaction(), CWallet::SyncTransaction(), TestBlockValidity(), TestLockPointValidity(), TransactionDesc::toHTML(), WalletModel::transactionCanBeAbandoned(), CInstantSend::TryToFinalizeLockCandidate(), UnloadBlockIndex(), WalletModel::unlockCoin(), CGovernanceManager::UpdateCachesAndClean(), CGovernanceObject::UpdateLocalValidity(), CMasternodeMan::UpdateMasternodeList(), TransactionRecord::updateStatus(), TransactionTablePriv::updateWallet(), validateaddress(), verifychain(), CVerifyDB::VerifyDB(), verifymessage(), verifytxoutproof(), VersionBitsTipState(), CInstantSend::Vote(), walletlock(), walletpassphrase(), and walletpassphrasechange().
CWaitableCriticalSection csBestBlock |
Definition at line 67 of file validation.cpp.
Referenced by getblocktemplate().
CConditionVariable cvBlockChange |
Definition at line 68 of file validation.cpp.
Referenced by getblocktemplate(), OnRPCStopped(), and UpdateTip().
|
static |
Time to wait (in seconds) between flushing chainstate to disk.
Definition at line 101 of file validation.h.
Referenced by FlushStateToDisk().
|
static |
Time to wait (in seconds) between writing blocks/block index to disk.
Definition at line 99 of file validation.h.
Referenced by FlushStateToDisk().
|
static |
Definition at line 124 of file validation.h.
Referenced by HelpMessage(), and InitBlockIndex().
|
static |
Default for accepting alerts from the P2P network.
Definition at line 51 of file validation.h.
Referenced by AppInit2(), and HelpMessage().
|
static |
Default for -limitancestorcount, max number of in-mempool ancestors
Definition at line 66 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), and HelpMessage().
|
static |
Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors
Definition at line 68 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), and HelpMessage().
|
static |
Definition at line 127 of file validation.h.
Referenced by HelpMessage(), and Misbehaving().
|
static |
Definition at line 121 of file validation.h.
Referenced by HelpMessage().
|
static |
Definition at line 190 of file validation.h.
Referenced by AppInit2(), HelpMessage(), and verifychain().
|
static |
Definition at line 191 of file validation.h.
Referenced by AppInit2(), HelpMessage(), and verifychain().
|
static |
Definition at line 122 of file validation.h.
Referenced by AppInit2(), and HelpMessage().
|
static |
Default for -limitdescendantcount, max number of in-mempool descendants
Definition at line 70 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), and HelpMessage().
|
static |
Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants
Definition at line 72 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), AppInit2(), and HelpMessage().
|
static |
Definition at line 62 of file validation.h.
Referenced by CDSNotificationInterface::UpdatedBlockTip().
|
static |
Default for -mempoolreplacement
Definition at line 131 of file validation.h.
Referenced by AppInit2(), and HelpMessage().
|
static |
Default for -minrelaytxfee, minimum relay fee for transactions We are ~100 times smaller then bitcoin now (2016-03-01), set minRelayTxFee only 10 times higher so it's still 10 times lower comparing to bitcoin. 2017-07: we are 10x smaller now, let's lower defaults 10x via the same BIP9 bit as DIP0001
Definition at line 61 of file validation.h.
Referenced by HelpMessage(), and CDSNotificationInterface::UpdatedBlockTip().
|
static |
Definition at line 116 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), and HelpMessage().
|
static |
Default for -maxorphantx, maximum number of orphan transactions kept in memory
Definition at line 64 of file validation.h.
Referenced by HelpMessage(), and ProcessMessage().
|
static |
Default for -mempoolexpiry, expiration time for mempool transactions in hours
Definition at line 74 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), ActivateBestChainStep(), HelpMessage(), and InvalidateBlock().
|
static |
Default for -permitbaremultisig
Definition at line 120 of file validation.h.
Referenced by AppInit2(), and HelpMessage().
|
static |
Definition at line 117 of file validation.h.
Referenced by AcceptToMemoryPoolWorker(), and HelpMessage().
|
static |
-par default (number of script-checking threads, 0 = auto)
Definition at line 85 of file validation.h.
Referenced by AppInit2(), HelpMessage(), and OptionsModel::Init().
|
static |
Definition at line 126 of file validation.h.
Referenced by HelpMessage(), and InitBlockIndex().
|
static |
Definition at line 129 of file validation.h.
Referenced by GetWarnings(), and HelpMessage().
|
static |
Definition at line 125 of file validation.h.
Referenced by HelpMessage(), and InitBlockIndex().
|
static |
Definition at line 123 of file validation.h.
Referenced by AppInit2(), HelpMessage(), and InitBlockIndex().
|
static |
Default for DEFAULT_WHITELISTFORCERELAY.
Definition at line 55 of file validation.h.
Referenced by HelpMessage(), InitParameterInteraction(), and ProcessMessage().
|
static |
Default for DEFAULT_WHITELISTRELAY.
Definition at line 53 of file validation.h.
Referenced by HelpMessage(), and ProcessMessage().
|
static |
Definition at line 167 of file validation.h.
Referenced by ComputeBlockVersion().
bool fAlerts |
Definition at line 85 of file validation.cpp.
Referenced by AppInit2(), and ProcessMessage().
bool fCheckBlockIndex |
Definition at line 81 of file validation.cpp.
Referenced by AppInit2(), and CheckBlockIndex().
bool fCheckpointsEnabled |
Definition at line 82 of file validation.cpp.
Referenced by AcceptBlockHeader(), AppInit2(), and TestBlockValidity().
std::atomic<bool> fDIP0001ActiveAtTip |
Definition at line 89 of file validation.cpp.
Referenced by CreateNewBlock(), getblocktemplate(), CTxLockRequest::GetMinFee(), CConnman::OutboundTargetReached(), and CDSNotificationInterface::UpdatedBlockTip().
std::atomic<bool> fDIP0001WasLockedIn |
Definition at line 88 of file validation.cpp.
Referenced by CMasternode::CalculateScore(), CMasternodePaymentVote::IsValid(), CMasternodePaymentVote::Relay(), and CDSNotificationInterface::UpdatedBlockTip().
bool fEnableReplacement |
Definition at line 86 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and AppInit2().
bool fHavePruned |
Pruning-related variables and constants True if any block files have ever been pruned.
Definition at line 76 of file validation.cpp.
Referenced by AppInit2(), CheckBlockIndex(), FlushStateToDisk(), getblock(), LoadBlockIndexDB(), rest_block(), and UnloadBlockIndex().
bool fImporting |
Definition at line 70 of file validation.cpp.
Referenced by CImportingNow::CImportingNow(), CMasternodeBroadcast::Create(), ClientModel::getBlockSource(), CWallet::GetMasternodeOutpointAndKeys(), CWallet::GetOutpointAndKeysFromOutput(), IsInitialBlockDownload(), masternodebroadcast(), ProcessMessage(), SendMessages(), and CImportingNow::~CImportingNow().
bool fIsBareMultisigStd |
Definition at line 78 of file validation.cpp.
Referenced by AppInit2(), and IsStandardTx().
bool fPruneMode |
True if we're running in -prune mode.
Definition at line 77 of file validation.cpp.
Referenced by AppInit2(), FindBlockPos(), FindUndoPos(), FlushStateToDisk(), getblockchaininfo(), importaddress(), importelectrumwallet(), importprivkey(), importpubkey(), importwallet(), and ProcessMessage().
bool fReindex |
Definition at line 71 of file validation.cpp.
Referenced by AppInit2(), CMasternodeBroadcast::Create(), FlushStateToDisk(), ClientModel::getBlockSource(), CWallet::GetMasternodeOutpointAndKeys(), CWallet::GetOutpointAndKeysFromOutput(), InitBlockIndex(), IsInitialBlockDownload(), LoadBlockIndex(), LoadBlockIndexDB(), masternodebroadcast(), ProcessMessage(), SendMessages(), and ThreadImport().
bool fRequireStandard |
Definition at line 79 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and AppInit2().
bool fTxIndex |
Definition at line 72 of file validation.cpp.
Referenced by AppInit2(), ConnectBlock(), GetTransaction(), InitBlockIndex(), and LoadBlockIndexDB().
uint256 hashAssumeValid |
Block hash whose ancestors we will assume to have valid scripts without checking them.
Definition at line 91 of file validation.cpp.
Referenced by AppInit2(), and ConnectBlock().
BlockMap mapBlockIndex |
Definition at line 64 of file validation.cpp.
Referenced by AcceptBlockHeader(), AddToBlockIndex(), CWallet::AddToWallet(), AlreadyHave(), AppInit2(), CMasternodePing::CheckAndUpdate(), CheckBlockIndex(), CMasternodeBroadcast::CheckOutpoint(), ConnectBlock(), FindForkInGlobalIndex(), getblock(), getblockheader(), getblockheaders(), getblocktemplate(), getchaintips(), CMerkleTx::GetDepthInMainChain(), CWallet::GetKeyBirthTimes(), Checkpoints::GetLastCheckpoint(), GetSpendHeight(), CCoinsViewDB::GetStats(), gettxout(), gettxoutproof(), InsertBlockIndex(), invalidateblock(), InvalidateBlock(), CGovernanceObject::IsCollateralValid(), listsinceblock(), LoadBlockIndexDB(), LoadExternalBlockFile(), CWallet::MarkConflicted(), ProcessGetData(), ProcessMessage(), PruneOneBlockFile(), reconsiderblock(), ReconsiderBlock(), ReprocessBlocks(), rest_block(), rest_headers(), SendMessages(), CMerkleTx::SetMerkleBranch(), CMasternodePing::SimpleCheck(), submitblock(), CInstantSend::SyncTransaction(), CPrivateSend::SyncTransaction(), TxToJSON(), UnloadBlockIndex(), TransactionRecord::updateStatus(), verifytxoutproof(), WalletTxToJSON(), and CMainCleanup::~CMainCleanup().
std::map<uint256, int64_t> mapRejectedBlocks |
Referenced by CheckBlock(), ConnectBlock(), and ReprocessBlocks().
|
static |
The maximum size of a blk?????.dat file (since 0.8)
Definition at line 76 of file validation.h.
Referenced by FindBlockPos().
|
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 ProcessMessage(), and SendMessages().
|
static |
Maximum number of headers to announce when relaying blocks with headers message.
Definition at line 134 of file validation.h.
Referenced by SendMessages(), and PeerLogicValidation::UpdatedBlockTip().
|
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(), and ProcessMessage().
|
static |
Maximum length of reject messages.
Definition at line 103 of file validation.h.
Referenced by PeerLogicValidation::BlockChecked(), and ProcessMessage().
|
static |
Maximum number of script-checking threads allowed
Definition at line 83 of file validation.h.
Referenced by AppInit2(), HelpMessage(), and OptionsDialog::OptionsDialog().
CTxMemPool mempool |
|
static |
Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned.
Definition at line 188 of file validation.h.
Referenced by AcceptBlock(), AppInit2(), FindFilesToPrune(), and ProcessMessage().
|
static |
Definition at line 201 of file validation.h.
Referenced by AppInit2(), and HelpMessage().
CFeeRate minRelayTxFee |
Fees smaller than this (in duffs) are considered zero fee (for relaying, mining and transaction creation)
Definition at line 94 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), AppInit2(), CreateNewBlock(), CWallet::CreateTransaction(), CTxOut::GetDustThreshold(), getinfo(), getnetworkinfo(), CWallet::GetRequiredFee(), CTxOut::IsDust(), GUIUtil::isDust(), IsStandardTx(), PaymentServer::processPaymentRequest(), CDSNotificationInterface::UpdatedBlockTip(), and CoinControlDialog::updateLabels().
unsigned int nBytesPerSigOp |
Definition at line 80 of file validation.cpp.
Referenced by AcceptToMemoryPoolWorker(), and AppInit2().
size_t nCoinCacheUsage |
Definition at line 83 of file validation.cpp.
Referenced by AppInit2(), FlushStateToDisk(), and CVerifyDB::VerifyDB().
uint64_t nLastBlockSize |
Definition at line 49 of file miner.cpp.
Referenced by CreateNewBlock(), and getmininginfo().
uint64_t nLastBlockTx |
Definition at line 48 of file miner.cpp.
Referenced by CreateNewBlock(), and getmininginfo().
|
static |
Minimum disk space required - used in CheckDiskSpace()
Definition at line 178 of file validation.h.
Referenced by CheckDiskSpace().
uint64_t nPruneTarget |
Number of MiB of block files that we're trying to stay below.
Definition at line 84 of file validation.cpp.
Referenced by AppInit2(), and FindFilesToPrune().
int nScriptCheckThreads |
Definition at line 69 of file validation.cpp.
Referenced by AppInit2(), and ConnectBlock().
CBlockTreeDB* pblocktree |
Global variable that points to the active block tree (protected by cs_main)
Definition at line 188 of file validation.cpp.
Referenced by AppInit2(), ConnectBlock(), DisconnectBlock(), FlushStateToDisk(), GetAddressIndex(), GetAddressUnspent(), GetSpentIndex(), GetTimestampIndex(), GetTransaction(), InitBlockIndex(), LoadBlockIndexDB(), PrepareShutdown(), and ThreadImport().
CCoinsViewCache* pcoinsTip |
Global variable that points to the active CCoinsView (protected by cs_main)
Definition at line 187 of file validation.cpp.
Referenced by AcceptToMemoryPool(), AcceptToMemoryPoolWorker(), ActivateBestChainStep(), AlreadyHave(), AppInit2(), CheckSequenceLocks(), ConnectTip(), DisconnectTip(), FlushStateToDisk(), GetTransaction(), gettxout(), gettxoutproof(), gettxoutsetinfo(), GetUTXOCoins(), InvalidateBlock(), LimitMempoolSize(), LoadBlockIndexDB(), PrepareShutdown(), ProcessMessage(), rest_getutxos(), sendrawtransaction(), signrawtransaction(), TestBlockValidity(), TransactionDesc::toHTML(), UpdateTip(), verifychain(), and CVerifyDB::VerifyDB().
CBlockIndex* pindexBestHeader |
Best header we've seen so far (used for getheaders queries' starting points).
Definition at line 66 of file validation.cpp.
Referenced by AddToBlockIndex(), ConnectBlock(), getblockchaininfo(), ClientModel::getHeaderTipHeight(), ClientModel::getHeaderTipTime(), LoadBlockIndexDB(), CMasternodeSync::NotifyHeaderTip(), NotifyHeaderTip(), ProcessGetData(), ProcessMessage(), SendMessages(), UnloadBlockIndex(), and CMasternodeSync::UpdatedBlockTip().
|
static |
Transaction is already known (either in mempool or blockchain)
Definition at line 864 of file validation.h.
Referenced by AcceptToMemoryPoolWorker().
|
static |
Transaction conflicts with a transaction already known
Definition at line 866 of file validation.h.
Referenced by AcceptToMemoryPoolWorker().
|
static |
Too high fee. Can not be triggered by P2P transactions
Definition at line 862 of file validation.h.
Referenced by AcceptToMemoryPoolWorker().
|
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 860 of file validation.h.
Referenced by PeerLogicValidation::BlockChecked(), and ProcessMessage().
const std::string strMessageMagic |
Definition at line 109 of file validation.cpp.
Referenced by SignVerifyMessageDialog::on_signMessageButton_SM_clicked(), SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked(), CMessageSigner::SignMessage(), signmessage(), CMessageSigner::VerifyMessage(), and verifymessage().
|
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 |
Definition at line 1876 of file validation.cpp.
Referenced by ComputeBlockVersion(), ConnectBlock(), ContextualCheckBlock(), ContextualCheckTransaction(), getblocktemplate(), UnloadBlockIndex(), CDSNotificationInterface::UpdatedBlockTip(), and VersionBitsTipState().