![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
#include "bignum.h"
#include "chainparams.h"
#include "coins.h"
#include "core.h"
#include "net.h"
#include "script.h"
#include "sync.h"
#include "txmempool.h"
#include "uint256.h"
#include <algorithm>
#include <exception>
#include <map>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Classes | |
struct | CNodeStateStats |
struct | CDiskBlockPos |
struct | CDiskTxPos |
class | CBlockUndo |
Undo information for a CBlock. More... | |
class | CScriptCheck |
Closure representing one script verification Note that this stores references to the spending transaction. More... | |
class | CMerkleTx |
A transaction with a merkle branch linking it to the block chain. More... | |
class | CPartialMerkleTree |
Data structure that represents a partial merkle tree. More... | |
class | CBlockFileInfo |
class | CBlockIndex |
The block chain is a tree shaped structure starting with the genesis block at the root, with each block potentially having multiple candidates to be the next block. More... | |
class | CDiskBlockIndex |
Used to marshal pointers into hashes for db storage. More... | |
class | CValidationState |
Capture information about block/transaction validation. More... | |
class | CChain |
An in-memory indexed chain of blocks. More... | |
struct | CBlockTemplate |
class | CMerkleBlock |
Used to relay blocks as header + vector<merkle branch> to filtered nodes. More... | |
class | CWalletInterface |
Enumerations | |
enum | GetMinFee_mode { GMF_RELAY, GMF_SEND } |
enum | BlockStatus { BLOCK_VALID_UNKNOWN = 0, BLOCK_VALID_HEADER = 1, BLOCK_VALID_TREE = 2, BLOCK_VALID_TRANSACTIONS = 3, BLOCK_VALID_CHAIN = 4, BLOCK_VALID_SCRIPTS = 5, BLOCK_VALID_MASK = 7, BLOCK_HAVE_DATA = 8, BLOCK_HAVE_UNDO = 16, BLOCK_HAVE_MASK = 24, BLOCK_FAILED_VALID = 32, BLOCK_FAILED_CHILD = 64, BLOCK_FAILED_MASK = 96 } |
Functions | |
void | RegisterWallet (CWalletInterface *pwalletIn) |
Register a wallet to receive updates from core. More... | |
void | UnregisterWallet (CWalletInterface *pwalletIn) |
Unregister a wallet from core. More... | |
void | UnregisterAllWallets () |
Unregister all wallets from core. More... | |
void | SyncWithWallets (const uint256 &hash, const CTransaction &tx, const CBlock *pblock=NULL) |
Push an updated transaction to all registered wallets. More... | |
void | RegisterNodeSignals (CNodeSignals &nodeSignals) |
Register with a network node to receive its signals. More... | |
void | UnregisterNodeSignals (CNodeSignals &nodeSignals) |
Unregister a network node. More... | |
void | PushGetBlocks (CNode *pnode, CBlockIndex *pindexBegin, uint256 hashEnd) |
bool | ProcessBlock (CValidationState &state, CNode *pfrom, CBlock *pblock, CDiskBlockPos *dbp=NULL) |
Process an incoming block. 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... | |
FILE * | OpenUndoFile (const CDiskBlockPos &pos, bool fReadOnly=false) |
Open an undo file (rev?????.dat) More... | |
bool | LoadExternalBlockFile (FILE *fileIn, CDiskBlockPos *dbp=NULL) |
Import blocks from an external file. More... | |
bool | InitBlockIndex () |
Initialize a new block tree database + block data on disk. More... | |
bool | LoadBlockIndex () |
Load the block tree and coins database from disk. More... | |
void | UnloadBlockIndex () |
Unload database information. More... | |
bool | VerifyDB (int nCheckLevel, int nCheckDepth) |
Verify consistency of the block and coin databases. More... | |
void | PrintBlockTree () |
Print the loaded block tree. More... | |
bool | ProcessMessages (CNode *pfrom) |
Process protocol messages received from a given node. More... | |
bool | SendMessages (CNode *pto, bool fSendTrickle) |
Send queued protocol messages to be sent to a give node. More... | |
void | ThreadScriptCheck () |
Run an instance of the script checking thread. More... | |
bool | CheckProofOfWork (uint256 hash, unsigned int nBits) |
Check whether a block hash satisfies the proof-of-work requirement specified by nBits. More... | |
unsigned int | ComputeMinWork (unsigned int nBase, int64_t nTime) |
Calculate the minimum amount of work a received block needs, without knowing its direct parent. More... | |
bool | IsInitialBlockDownload () |
Check whether we are doing an initial block download (synchronizing from disk or network) More... | |
std::string | GetWarnings (std::string strFor) |
Format a string that describes several potential problems detected by the core. More... | |
bool | GetTransaction (const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow=false) |
Retrieve a transaction (from memory pool, or from disk, if possible) More... | |
bool | ActivateBestChain (CValidationState &state) |
Find the best known block, and make it the tip of the block chain. More... | |
int64_t | GetBlockValue (int nHeight, int64_t nFees) |
unsigned int | GetNextWorkRequired (const CBlockIndex *pindexLast, const CBlockHeader *pblock) |
void | UpdateTime (CBlockHeader &block, const CBlockIndex *pindexPrev) |
CBlockIndex * | InsertBlockIndex (uint256 hash) |
Create a new block index entry for a given block hash. More... | |
bool | VerifySignature (const CCoins &txFrom, const CTransaction &txTo, unsigned int nIn, unsigned int flags, int nHashType) |
Verify a signature. More... | |
bool | AbortNode (const std::string &msg) |
Abort with a message. More... | |
bool | GetNodeStateStats (NodeId nodeid, CNodeStateStats &stats) |
Get statistics from node state. More... | |
void | Misbehaving (NodeId nodeid, int howmuch) |
Increase a node's misbehavior score. More... | |
bool | AcceptToMemoryPool (CTxMemPool &pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool *pfMissingInputs, bool fRejectInsaneFee=false) |
(try to) add transaction to memory pool More... | |
int64_t | GetMinFee (const CTransaction &tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode) |
bool | AreInputsStandard (const CTransaction &tx, CCoinsViewCache &mapInputs) |
Check for standard transaction types. More... | |
unsigned int | GetLegacySigOpCount (const CTransaction &tx) |
Count ECDSA signature operations the old-fashioned (pre-0.6) way. More... | |
unsigned int | GetP2SHSigOpCount (const CTransaction &tx, CCoinsViewCache &mapInputs) |
Count ECDSA signature operations in pay-to-script-hash inputs. More... | |
bool | AllowFree (double dPriority) |
bool | CheckInputs (const CTransaction &tx, CValidationState &state, CCoinsViewCache &view, bool fScriptChecks=true, unsigned int flags=SCRIPT_VERIFY_P2SH|SCRIPT_VERIFY_STRICTENC, std::vector< CScriptCheck > *pvChecks=NULL) |
void | UpdateCoins (const CTransaction &tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash) |
bool | CheckTransaction (const CTransaction &tx, CValidationState &state) |
bool | IsStandardTx (const CTransaction &tx, std::string &reason) |
Check for standard transaction types. More... | |
bool | IsFinalTx (const CTransaction &tx, int nBlockHeight=0, int64_t nBlockTime=0) |
bool | WriteBlockToDisk (CBlock &block, CDiskBlockPos &pos) |
Functions for disk access for blocks. More... | |
bool | ReadBlockFromDisk (CBlock &block, const CDiskBlockPos &pos) |
bool | ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex) |
bool | DisconnectBlock (CBlock &block, CValidationState &state, CBlockIndex *pindex, CCoinsViewCache &coins, bool *pfClean=NULL) |
Functions for validating blocks and updating the block tree. More... | |
bool | ConnectBlock (CBlock &block, CValidationState &state, CBlockIndex *pindex, CCoinsViewCache &coins, bool fJustCheck=false) |
bool | AddToBlockIndex (CBlock &block, CValidationState &state, const CDiskBlockPos &pos) |
bool | CheckBlock (const CBlock &block, CValidationState &state, bool fCheckPOW=true, bool fCheckMerkleRoot=true) |
bool | AcceptBlock (CBlock &block, CValidationState &state, CDiskBlockPos *dbp=NULL) |
Variables | |
static const unsigned int | MAX_BLOCK_SIZE = 1000000 |
The maximum allowed size for a serialized block, in bytes (network rule) More... | |
static const unsigned int | DEFAULT_BLOCK_MAX_SIZE = 750000 |
Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create. More... | |
static const unsigned int | DEFAULT_BLOCK_MIN_SIZE = 0 |
static const unsigned int | DEFAULT_BLOCK_PRIORITY_SIZE = 50000 |
Default for -blockprioritysize, maximum space for zero/low-fee transactions. More... | |
static const unsigned int | MAX_STANDARD_TX_SIZE = 100000 |
The maximum size for transactions we're willing to relay/mine. More... | |
static const unsigned int | MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50 |
The maximum allowed number of signature check operations in a block (network rule) More... | |
static const unsigned int | DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100 |
Default for -maxorphantx, maximum number of orphan transactions kept in memory. More... | |
static const unsigned int | DEFAULT_MAX_ORPHAN_BLOCKS = 750 |
Default for -maxorphanblocks, maximum number of orphan blocks kept in memory. 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 | COINBASE_MATURITY = 100 |
Coinbase transaction outputs can only be spent after this number of new blocks (network rule) More... | |
static const unsigned int | LOCKTIME_THRESHOLD = 500000000 |
Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. 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 = 128 |
Number of blocks that can be requested at any given time from a single peer. More... | |
static const unsigned int | BLOCK_DOWNLOAD_TIMEOUT = 60 |
Timeout in seconds before considering a block download peer unresponsive. More... | |
static const int | fHaveUPnP = false |
static const unsigned char | REJECT_MALFORMED = 0x01 |
"reject" message codes More... | |
static const unsigned char | REJECT_INVALID = 0x10 |
static const unsigned char | REJECT_OBSOLETE = 0x11 |
static const unsigned char | REJECT_DUPLICATE = 0x12 |
static const unsigned char | REJECT_NONSTANDARD = 0x40 |
static const unsigned char | REJECT_DUST = 0x41 |
static const unsigned char | REJECT_INSUFFICIENTFEE = 0x42 |
static const unsigned char | REJECT_CHECKPOINT = 0x43 |
CScript | COINBASE_FLAGS |
CCriticalSection | cs_main |
CTxMemPool | mempool |
std::map< uint256, CBlockIndex * > | mapBlockIndex |
uint64_t | nLastBlockTx |
uint64_t | nLastBlockSize |
const std::string | strMessageMagic |
int64_t | nTimeBestReceived |
bool | fImporting |
bool | fReindex |
bool | fBenchmark |
int | nScriptCheckThreads |
bool | fTxIndex |
unsigned int | nCoinCacheSize |
static const uint64_t | nMinDiskSpace = 52428800 |
CChain | chainActive |
The currently-connected chain of blocks. More... | |
CChain | chainMostWork |
The currently best known chain of headers (some of which may be invalid). More... | |
CCoinsViewCache * | pcoinsTip |
Global variable that points to the active CCoinsView (protected by cs_main) More... | |
CBlockTreeDB * | pblocktree |
Global variable that points to the active block tree (protected by cs_main) More... | |
enum BlockStatus |
enum GetMinFee_mode |
bool AbortNode | ( | const std::string & | msg | ) |
Abort with a message.
Definition at line 2798 of file main.cpp.
References LogPrintf, CClientUIInterface::MSG_ERROR, StartShutdown(), strMiscWarning, CClientUIInterface::ThreadSafeMessageBox, and uiInterface.
Referenced by CValidationState::Abort(), CheckDiskSpace(), and LoadExternalBlockFile().
bool AcceptBlock | ( | CBlock & | block, |
CValidationState & | state, | ||
CDiskBlockPos * | dbp = NULL |
||
) |
Definition at line 2405 of file main.cpp.
References _(), CValidationState::Abort(), AddToBlockIndex(), AssertLockHeld, Checkpoints::CheckBlock(), CLIENT_VERSION, cs_vNodes, CValidationState::DoS(), error(), FindBlockPos(), CBlockIndex::GetBlockHash(), CBlockHeader::GetBlockTime(), CBlockHeader::GetHash(), Checkpoints::GetLastCheckpoint(), CBlockIndex::GetMedianTimePast(), GetNextWorkRequired(), GetSerializeSize(), Checkpoints::GetTotalBlocksEstimate(), CBlockHeader::hashPrevBlock, CChain::Height(), CValidationState::Invalid(), IsFinalTx(), CBlockIndex::IsSuperMajority(), LOCK, MSG_BLOCK, CBlockHeader::nBits, CBlockIndex::nHeight, CNode::nStartingHeight, CBlockHeader::nTime, CBlockHeader::nVersion, Params(), CNode::PushInventory(), REJECT_CHECKPOINT, REJECT_INVALID, REJECT_OBSOLETE, SER_DISK, TestNet(), CChain::Tip(), vNodes, CBlock::vtx, and WriteBlockToDisk().
Referenced by ProcessBlock().
bool AcceptToMemoryPool | ( | CTxMemPool & | pool, |
CValidationState & | state, | ||
const CTransaction & | tx, | ||
bool | fLimitFree, | ||
bool * | pfMissingInputs, | ||
bool | fRejectInsaneFee = false |
||
) |
(try to) add transaction to memory pool
Definition at line 852 of file main.cpp.
References CTxMemPool::addUnchecked(), AreInputsStandard(), AssertLockHeld, CheckInputs(), CheckTransaction(), CTxMemPool::cs, CValidationState::DoS(), error(), CTxMemPool::exists(), g_signals, GetArg(), CCoinsViewCache::GetBestBlock(), CTransaction::GetHash(), GetMinFee(), CCoinsViewCache::GetPriority(), GetTime(), CCoinsViewCache::GetValueIn(), CTransaction::GetValueOut(), GMF_RELAY, COutPoint::hash, CCoinsViewCache::HaveCoins(), CCoinsViewCache::HaveInputs(), CChain::Height(), CValidationState::Invalid(), CTransaction::IsCoinBase(), IsStandardTx(), LOCK, LogPrint(), CChainParams::MAIN, CTxMemPool::mapNextTx, CTransaction::nMinRelayTxFee, Params(), CTxIn::prevout, REJECT_DUPLICATE, REJECT_INSUFFICIENTFEE, REJECT_INVALID, REJECT_NONSTANDARD, SCRIPT_VERIFY_P2SH, SCRIPT_VERIFY_STRICTENC, CCoinsViewBacked::SetBackend(), base_uint< BITS >::ToString(), and CTransaction::vin.
Referenced by CMerkleTx::AcceptToMemoryPool(), DisconnectTip(), ProcessMessage(), and sendrawtransaction().
bool ActivateBestChain | ( | CValidationState & | state | ) |
Find the best known block, and make it the tip of the block chain.
Definition at line 2138 of file main.cpp.
References ConnectTip(), CChain::Contains(), CValidationState::CorruptionPossible(), DisconnectTip(), FindMostWorkChain(), GetArg(), CBlockIndex::GetBlockHash(), base_uint< BITS >::GetHex(), CChain::Height(), InvalidChainFound(), IsInitialBlockDownload(), CValidationState::IsInvalid(), LOCK, runCommand(), and CChain::Tip().
Referenced by AddToBlockIndex(), and AppInit2().
bool AddToBlockIndex | ( | CBlock & | block, |
CValidationState & | state, | ||
const CDiskBlockPos & | pos | ||
) |
Definition at line 2186 of file main.cpp.
References _(), CValidationState::Abort(), ActivateBestChain(), BLOCK_HAVE_DATA, BLOCK_VALID_TRANSACTIONS, CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), error(), CLevelDBWrapper::Flush(), g_signals, CBlockIndex::GetBlockWork(), CBlockHeader::GetHash(), CBlock::GetTxHash(), CBigNum::getuint256(), CBlockHeader::hashPrevBlock, CValidationState::Invalid(), LOCK, CBlockIndex::nChainTx, CBlockIndex::nChainWork, CBlockIndex::nDataPos, CDiskBlockPos::nFile, CBlockIndex::nFile, CBlockIndex::nHeight, CClientUIInterface::NotifyBlocksChanged, CDiskBlockPos::nPos, CBlockIndex::nSequenceId, CBlockIndex::nStatus, CBlockIndex::nTx, CBlockIndex::nUndoPos, CBlockIndex::phashBlock, CBlockIndex::pprev, CChain::Tip(), base_uint< BITS >::ToString(), uiInterface, CBlock::vtx, and CBlockTreeDB::WriteBlockIndex().
Referenced by AcceptBlock(), and InitBlockIndex().
|
inline |
Definition at line 299 of file main.h.
References COIN.
Referenced by CreateNewBlock(), CoinControlDialog::getPriorityLabel(), and CoinControlDialog::updateLabels().
bool AreInputsStandard | ( | const CTransaction & | tx, |
CCoinsViewCache & | mapInputs | ||
) |
Check for standard transaction types.
[in] | mapInputs | Map of previous transactions that have outputs we're spending |
Definition at line 623 of file main.cpp.
References EvalScript(), CCoinsViewCache::GetOutputFor(), CTransaction::IsCoinBase(), CTxOut::scriptPubKey, ScriptSigArgsExpected(), Solver(), TX_SCRIPTHASH, and CTransaction::vin.
Referenced by AcceptToMemoryPool().
bool CheckBlock | ( | const CBlock & | block, |
CValidationState & | state, | ||
bool | fCheckPOW = true , |
||
bool | fCheckMerkleRoot = true |
||
) |
Definition at line 2339 of file main.cpp.
References CBlock::BuildMerkleTree(), CheckProofOfWork(), CheckTransaction(), CValidationState::DoS(), error(), GetAdjustedTime(), CBlockHeader::GetBlockTime(), CBlockHeader::GetHash(), GetLegacySigOpCount(), GetSerializeSize(), CBlock::GetTxHash(), CBlockHeader::hashMerkleRoot, CValidationState::Invalid(), MAX_BLOCK_SIGOPS, MAX_BLOCK_SIZE, CBlockHeader::nBits, PROTOCOL_VERSION, REJECT_INVALID, SER_NETWORK, CBlock::vMerkleTree, and CBlock::vtx.
Referenced by ConnectBlock(), ProcessBlock(), and VerifyDB().
bool CheckDiskSpace | ( | uint64_t | nAdditionalBytes = 0 | ) |
Check whether enough disk space is available for an incoming block.
Definition at line 2806 of file main.cpp.
References _(), AbortNode(), GetDataDir(), and nMinDiskSpace.
Referenced by AppInit2(), FindBlockPos(), FindUndoPos(), and WriteChainState().
bool CheckInputs | ( | const CTransaction & | tx, |
CValidationState & | state, | ||
CCoinsViewCache & | view, | ||
bool | fScriptChecks = true , |
||
unsigned int | flags = SCRIPT_VERIFY_P2SH|SCRIPT_VERIFY_STRICTENC , |
||
std::vector< CScriptCheck > * | pvChecks = NULL |
||
) |
Definition at line 1549 of file main.cpp.
References COINBASE_MATURITY, CValidationState::DoS(), error(), CCoinsViewCache::GetBestBlock(), CCoinsViewCache::GetCoins(), CTransaction::GetHash(), CTransaction::GetValueOut(), COutPoint::hash, CCoinsViewCache::HaveInputs(), CValidationState::Invalid(), CCoins::IsCoinBase(), CTransaction::IsCoinBase(), MoneyRange(), COutPoint::n, CCoins::nHeight, CBlockIndex::nHeight, REJECT_INVALID, REJECT_NONSTANDARD, SCRIPT_VERIFY_STRICTENC, CScriptCheck::swap(), base_uint< BITS >::ToString(), CTransaction::vin, and CCoins::vout.
Referenced by AcceptToMemoryPool(), ConnectBlock(), and CreateNewBlock().
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
Definition at line 1325 of file main.cpp.
References error(), CBigNum::getuint256(), Params(), and CBigNum::SetCompact().
Referenced by CheckBlock(), CBlockIndex::CheckIndex(), and ReadBlockFromDisk().
bool CheckTransaction | ( | const CTransaction & | tx, |
CValidationState & | state | ||
) |
Definition at line 760 of file main.cpp.
References CValidationState::DoS(), error(), GetSerializeSize(), CTransaction::IsCoinBase(), COutPoint::IsNull(), MAX_BLOCK_SIZE, MAX_MONEY, MoneyRange(), CTxOut::nValue, CTxIn::prevout, PROTOCOL_VERSION, REJECT_INVALID, SER_NETWORK, CTransaction::vin, and CTransaction::vout.
Referenced by AcceptToMemoryPool(), CheckBlock(), and ReadKeyValue().
Calculate the minimum amount of work a received block needs, without knowing its direct parent.
Definition at line 1241 of file main.cpp.
References CBigNum::GetCompact(), Params(), CChainParams::ProofOfWorkLimit(), CBigNum::SetCompact(), and TestNet().
Referenced by ProcessBlock().
bool ConnectBlock | ( | CBlock & | block, |
CValidationState & | state, | ||
CBlockIndex * | pindex, | ||
CCoinsViewCache & | coins, | ||
bool | fJustCheck = false |
||
) |
Definition at line 1758 of file main.cpp.
References _(), CValidationState::Abort(), CCheckQueueControl< T >::Add(), AssertLockHeld, BLOCK_HAVE_UNDO, BLOCK_VALID_MASK, BLOCK_VALID_SCRIPTS, CheckBlock(), CheckInputs(), CLIENT_VERSION, CValidationState::DoS(), error(), fBenchmark, FindUndoPos(), fTxIndex, g_signals, CCoinsViewCache::GetBestBlock(), CBlockIndex::GetBlockHash(), CBlockIndex::GetBlockPos(), GetBlockValue(), CCoinsViewCache::GetCoins(), CBlockHeader::GetHash(), GetLegacySigOpCount(), GetP2SHSigOpCount(), GetSerializeSize(), GetSizeOfCompactSize(), GetTimeMicros(), Checkpoints::GetTotalBlocksEstimate(), CBlock::GetTxHash(), CBlockIndex::GetUndoPos(), CCoinsViewCache::GetValueIn(), CTransaction::GetValueOut(), CChainParams::HashGenesisBlock(), CCoinsViewCache::HaveCoins(), CCoinsViewCache::HaveInputs(), CTransaction::IsCoinBase(), CDiskBlockPos::IsNull(), LogPrintf, MAX_BLOCK_SIGOPS, CBlockIndex::nFile, CBlockIndex::nHeight, CDiskBlockPos::nPos, CBlockIndex::nStatus, CBlockIndex::nTime, CDiskTxPos::nTxOffset, CBlockIndex::nUndoPos, Params(), CBlockIndex::phashBlock, CBlockIndex::pprev, REJECT_INVALID, SCRIPT_VERIFY_NOCACHE, SCRIPT_VERIFY_NONE, SCRIPT_VERIFY_P2SH, scriptcheckqueue, SER_DISK, CCoinsViewCache::SetBestBlock(), UpdateCoins(), CTransaction::vin, CBlock::vtx, CBlockUndo::vtxundo, CCheckQueueControl< T >::Wait(), CBlockTreeDB::WriteBlockIndex(), and CBlockTreeDB::WriteTxIndex().
Referenced by ConnectTip(), CreateNewBlock(), and VerifyDB().
bool DisconnectBlock | ( | CBlock & | block, |
CValidationState & | state, | ||
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 1638 of file main.cpp.
References CCoins::ClearUnspendable(), error(), CCoins::fCoinBase, CTxInUndo::fCoinBase, CCoinsViewCache::GetBestBlock(), CBlockIndex::GetBlockHash(), CCoinsViewCache::GetCoins(), CTransaction::GetHash(), CBlockIndex::GetUndoPos(), COutPoint::hash, CCoinsViewCache::HaveCoins(), CCoins::IsAvailable(), CDiskBlockPos::IsNull(), CCoins::IsPruned(), COutPoint::n, CCoins::nHeight, CTxInUndo::nHeight, CBlockIndex::nHeight, CCoins::nVersion, CTxInUndo::nVersion, CBlockIndex::pprev, CCoinsViewCache::SetBestBlock(), CCoinsViewCache::SetCoins(), CTxInUndo::txout, CTransaction::vin, CCoins::vout, CTxUndo::vprevout, CBlock::vtx, and CBlockUndo::vtxundo.
Referenced by DisconnectTip(), and VerifyDB().
int64_t GetBlockValue | ( | int | nHeight, |
int64_t | nFees | ||
) |
Definition at line 1218 of file main.cpp.
References COIN, Params(), and CChainParams::SubsidyHalvingInterval().
Referenced by ConnectBlock(), and CreateNewBlock().
unsigned int GetLegacySigOpCount | ( | const CTransaction & | tx | ) |
Count ECDSA signature operations the old-fashioned (pre-0.6) way.
Definition at line 677 of file main.cpp.
References CScript::GetSigOpCount(), CTxOut::scriptPubKey, CTxIn::scriptSig, CTransaction::vin, and CTransaction::vout.
Referenced by CheckBlock(), ConnectBlock(), and CreateNewBlock().
int64_t GetMinFee | ( | const CTransaction & | tx, |
unsigned int | nBytes, | ||
bool | fAllowFree, | ||
enum GetMinFee_mode | mode | ||
) |
Definition at line 817 of file main.cpp.
References CENT, DEFAULT_BLOCK_PRIORITY_SIZE, GMF_RELAY, GMF_SEND, MAX_MONEY, MoneyRange(), CTransaction::nMinRelayTxFee, CTransaction::nMinTxFee, CTxOut::nValue, and CTransaction::vout.
Referenced by AcceptToMemoryPool(), and CoinControlDialog::updateLabels().
unsigned int GetNextWorkRequired | ( | const CBlockIndex * | pindexLast, |
const CBlockHeader * | pblock | ||
) |
debug print
Definition at line 1263 of file main.cpp.
References CBlockIndex::GetBlockTime(), CBigNum::GetCompact(), CBigNum::getuint256(), LogPrintf, CBlockIndex::nBits, CBlockIndex::nHeight, nTargetTimespan, CBlockHeader::nTime, CBlockIndex::nTime, Params(), CBlockIndex::pprev, CChainParams::ProofOfWorkLimit(), CBigNum::SetCompact(), TestNet(), and base_uint< BITS >::ToString().
Referenced by AcceptBlock(), CreateNewBlock(), and UpdateTime().
bool GetNodeStateStats | ( | NodeId | nodeid, |
CNodeStateStats & | stats | ||
) |
Get statistics from node state.
Definition at line 327 of file main.cpp.
References LOCK, and CNodeStateStats::nMisbehavior.
Referenced by getpeerinfo().
unsigned int GetP2SHSigOpCount | ( | const CTransaction & | tx, |
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 691 of file main.cpp.
References CCoinsViewCache::GetOutputFor(), CScript::GetSigOpCount(), CTransaction::IsCoinBase(), CScript::IsPayToScriptHash(), CTxOut::scriptPubKey, and CTransaction::vin.
Referenced by ConnectBlock(), and CreateNewBlock().
bool GetTransaction | ( | const uint256 & | hash, |
CTransaction & | tx, | ||
uint256 & | hashBlock, | ||
bool | fAllowSlow = false |
||
) |
Retrieve a transaction (from memory pool, or from disk, if possible)
Definition at line 1049 of file main.cpp.
References CLIENT_VERSION, error(), fTxIndex, CBlockIndex::GetBlockHash(), CCoinsViewCache::GetCoins(), CTransaction::GetHash(), CBlockHeader::GetHash(), LOCK, CTxMemPool::lookup(), CCoins::nHeight, CDiskTxPos::nTxOffset, OpenBlockFile(), pcoinsTip, ReadBlockFromDisk(), CBlockTreeDB::ReadTxIndex(), SER_DISK, and CBlock::vtx.
Referenced by getactivecrowdsales_MP(), getcrowdsale_MP(), getrawtransaction(), getsto_MP(), gettrade_MP(), parseTransaction(), populateRPCTransactionObject(), and CMPTxList::setLastAlert().
std::string GetWarnings | ( | std::string | strFor | ) |
Format a string that describes several potential problems detected by the core.
Definition at line 3204 of file main.cpp.
References _(), CAlert::AppliesToMe(), CLIENT_VERSION_IS_RELEASE, cs_mapAlerts, GetBoolArg(), LOCK, mapAlerts, CUnsignedAlert::nPriority, PAIRTYPE, strMiscWarning, and CUnsignedAlert::strStatusBar.
Referenced by CRPCTable::execute(), getinfo(), getmininginfo(), and ClientModel::getStatusBarWarnings().
bool InitBlockIndex | ( | ) |
Initialize a new block tree database + block data on disk.
Definition at line 3014 of file main.cpp.
References AddToBlockIndex(), CLIENT_VERSION, error(), FindBlockPos(), fReindex, fTxIndex, CChain::Genesis(), CChainParams::GenesisBlock(), GetBoolArg(), GetSerializeSize(), LOCK, LogPrintf, CBlockHeader::nTime, Params(), SER_DISK, WriteBlockToDisk(), and CBlockTreeDB::WriteFlag().
Referenced by AppInit2(), and ThreadImport().
CBlockIndex* InsertBlockIndex | ( | uint256 | hash | ) |
Create a new block index entry for a given block hash.
Definition at line 2848 of file main.cpp.
Referenced by CBlockTreeDB::LoadBlockIndexGuts().
bool IsFinalTx | ( | const CTransaction & | tx, |
int | nBlockHeight = 0 , |
||
int64_t | nBlockTime = 0 |
||
) |
Definition at line 594 of file main.cpp.
References AssertLockHeld, GetAdjustedTime(), CChain::Height(), LOCKTIME_THRESHOLD, CTransaction::nLockTime, and CTransaction::vin.
Referenced by AcceptBlock(), CWallet::AvailableCoins(), CreateNewBlock(), TransactionDesc::FormatTxStatus(), GetAccountBalance(), CWallet::GetAddressBalances(), getreceivedbyaccount(), getreceivedbyaddress(), CWallet::GetUnconfirmedBalance(), IsStandardTx(), CWalletTx::IsTrusted(), ListReceived(), and TransactionRecord::updateStatus().
bool IsInitialBlockDownload | ( | ) |
Check whether we are doing an initial block download (synchronizing from disk or network)
Definition at line 1341 of file main.cpp.
References fImporting, fReindex, CBlockIndex::GetBlockTime(), GetTime(), Checkpoints::GetTotalBlocksEstimate(), CChain::Height(), LOCK, and CChain::Tip().
Referenced by ActivateBestChain(), CheckForkWarningConditions(), getblocktemplate(), ClientModel::inInitialBlockDownload(), ProcessMessage(), SendMessages(), UpdateTip(), WriteBlockToDisk(), and WriteChainState().
bool IsStandardTx | ( | const CTransaction & | tx, |
std::string & | reason | ||
) |
Check for standard transaction types.
Definition at line 507 of file main.cpp.
References AssertLockHeld, CTransaction::CURRENT_VERSION, CScript::HasCanonicalPushes(), CChain::Height(), CTxOut::IsDust(), IsFinalTx(), CScript::IsPushOnly(), IsStandard(), MAX_STANDARD_TX_SIZE, CTransaction::nMinRelayTxFee, CTransaction::nVersion, CTxOut::scriptPubKey, CTxIn::scriptSig, SER_NETWORK, TX_NULL_DATA, CTransaction::vin, and CTransaction::vout.
Referenced by AcceptToMemoryPool().
bool LoadBlockIndex | ( | ) |
Load the block tree and coins database from disk.
Definition at line 3005 of file main.cpp.
References fReindex, and LoadBlockIndexDB().
Referenced by AppInit2().
bool LoadExternalBlockFile | ( | FILE * | fileIn, |
CDiskBlockPos * | dbp = NULL |
||
) |
Import blocks from an external file.
Definition at line 3118 of file main.cpp.
References _(), AbortNode(), CLIENT_VERSION, CBufferedFile::eof(), CBufferedFile::FindByte(), FLATDATA, CBufferedFile::GetPos(), GetTimeMillis(), CBufferedFile::good(), CValidationState::IsError(), LOCK, LogPrintf, MAX_BLOCK_SIZE, MESSAGE_START_SIZE, CDiskBlockPos::nFile, CDiskBlockPos::nPos, CBlockFileInfo::nSize, Params(), ProcessBlock(), CBlockTreeDB::ReadBlockFileInfo(), CBufferedFile::Seek(), SER_DISK, CBufferedFile::SetLimit(), and CBufferedFile::SetPos().
Referenced by ThreadImport().
Increase a node's misbehavior score.
Definition at line 1441 of file main.cpp.
References GetArg(), and LogPrintf.
Referenced by InvalidBlockFound(), and ProcessMessage().
FILE* OpenBlockFile | ( | const CDiskBlockPos & | pos, |
bool | fReadOnly = false |
||
) |
Open a block file (blk?????.dat)
Definition at line 2840 of file main.cpp.
References OpenDiskFile().
Referenced by FindBlockPos(), FlushBlockFile(), GetTransaction(), ReadBlockFromDisk(), ThreadImport(), and WriteBlockToDisk().
FILE* OpenUndoFile | ( | const CDiskBlockPos & | pos, |
bool | fReadOnly = false |
||
) |
Open an undo file (rev?????.dat)
Definition at line 2844 of file main.cpp.
References OpenDiskFile().
Referenced by FindUndoPos(), and FlushBlockFile().
void PrintBlockTree | ( | ) |
Print the loaded block tree.
Definition at line 3049 of file main.cpp.
References AssertLockHeld, DateTimeStrFormat(), CChain::Genesis(), CBlockIndex::GetBlockPos(), CBlockHeader::GetBlockTime(), LogPrintf, CChain::Next(), CDiskBlockPos::nFile, CBlockIndex::nHeight, CDiskBlockPos::nPos, CBlockIndex::pprev, ReadBlockFromDisk(), and CBlock::vtx.
Referenced by AppInit2().
bool ProcessBlock | ( | CValidationState & | state, |
CNode * | pfrom, | ||
CBlock * | pblock, | ||
CDiskBlockPos * | dbp = NULL |
||
) |
Process an incoming block.
Definition at line 2542 of file main.cpp.
References AcceptBlock(), AssertLockHeld, CDataStream::begin(), CBlock::BuildMerkleTree(), CheckBlock(), CLIENT_VERSION, ComputeMinWork(), CValidationState::DoS(), CDataStream::end(), error(), CBlockIndex::GetBlockHash(), CBlockHeader::GetBlockTime(), CBlockHeader::GetHash(), Checkpoints::GetLastCheckpoint(), GetOrphanRoot(), COrphanBlock::hashBlock, COrphanBlock::hashPrev, CBlockHeader::hashPrevBlock, CValidationState::Invalid(), LogPrintf, CBlockHeader::nBits, CBlockIndex::nBits, CBlockIndex::nTime, PruneOrphanBlocks(), PushGetBlocks(), REJECT_CHECKPOINT, REJECT_INVALID, SER_DISK, CBigNum::SetCompact(), CChain::Tip(), base_uint< BITS >::ToString(), and COrphanBlock::vchBlock.
Referenced by LoadExternalBlockFile(), ProcessMessage(), and submitblock().
bool ProcessMessages | ( | CNode * | pfrom | ) |
Process protocol messages received from a given node.
Definition at line 4114 of file main.cpp.
References CDataStream::begin(), CNetMessage::complete(), CNode::fDisconnect, CMessageHeader::GetCommand(), Hash(), CNetMessage::hdr, CMessageHeader::IsValid(), LogPrintf, memcpy(), MESSAGE_START_SIZE, CMessageHeader::nChecksum, CMessageHeader::nMessageSize, CNode::nSendSize, Params(), CMessageHeader::pchMessageStart, PrintExceptionContinue(), ProcessGetData(), ProcessMessage(), CNode::PushMessage(), REJECT_MALFORMED, SendBufferSize(), CNetMessage::vRecv, CNode::vRecvGetData, and CNode::vRecvMsg.
Referenced by RegisterNodeSignals(), and UnregisterNodeSignals().
void PushGetBlocks | ( | CNode * | pnode, |
CBlockIndex * | pindexBegin, | ||
uint256 | hashEnd | ||
) |
Definition at line 2530 of file main.cpp.
References AssertLockHeld, CChain::GetLocator(), CNode::hashLastGetBlocksEnd, CNode::pindexLastGetBlocksBegin, and CNode::PushMessage().
Referenced by ProcessBlock(), ProcessMessage(), and SendMessages().
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CDiskBlockPos & | pos | ||
) |
Definition at line 1145 of file main.cpp.
References CheckProofOfWork(), CLIENT_VERSION, error(), CBlockHeader::GetHash(), CBlockHeader::nBits, OpenBlockFile(), and SER_DISK.
Referenced by AppInit2(), ConnectTip(), DisconnectTip(), getblock(), GetTransaction(), listblocktransactions_MP(), msc_initial_scan(), PrintBlockTree(), ProcessGetData(), ReadBlockFromDisk(), CWallet::ScanForWalletTransactions(), and VerifyDB().
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CBlockIndex * | pindex | ||
) |
Definition at line 1169 of file main.cpp.
References error(), CBlockIndex::GetBlockHash(), CBlockIndex::GetBlockPos(), CBlockHeader::GetHash(), and ReadBlockFromDisk().
void RegisterNodeSignals | ( | CNodeSignals & | nodeSignals | ) |
Register with a network node to receive its signals.
Definition at line 336 of file main.cpp.
References CNodeSignals::FinalizeNode, CNodeSignals::GetHeight, mastercore::GetHeight(), CNodeSignals::InitializeNode, CNodeSignals::ProcessMessages, ProcessMessages(), CNodeSignals::SendMessages, and SendMessages().
Referenced by AppInit2().
void RegisterWallet | ( | CWalletInterface * | pwalletIn | ) |
Register a wallet to receive updates from core.
Definition at line 160 of file main.cpp.
References CWalletInterface::EraseFromWallet(), g_signals, CWalletInterface::Inventory(), CWalletInterface::ResendWalletTransactions(), CWalletInterface::SetBestChain(), CWalletInterface::SyncTransaction(), and CWalletInterface::UpdatedTransaction().
Referenced by AppInit2().
bool SendMessages | ( | CNode * | pto, |
bool | fSendTrickle | ||
) |
Send queued protocol messages to be sent to a give node.
Definition at line 4235 of file main.cpp.
References CNode::addr, AlreadyHave(), CNode::Ban(), BEGIN, BIP0031_VERSION, BLOCK_DOWNLOAD_TIMEOUT, mruset< T >::clear(), mruset< T >::count(), CNode::cs_inventory, cs_vNodes, END, fDebug, CNode::fDisconnect, fImporting, fNoListen, CNode::fPingQueued, fReindex, CNode::fStartSync, g_signals, CNode::GetId(), GetLocalAddress(), GetRandHash(), GetTime(), GetTimeMicros(), Hash(), CInv::hash, mruset< T >::insert(), IsInitialBlockDownload(), CNetAddr::IsLocal(), CNetAddr::IsRoutable(), LOCK, LogPrint(), LogPrintf, CNode::mapAskFor, MAX_BLOCKS_IN_TRANSIT_PER_PEER, MSG_BLOCK, MSG_TX, CNode::nLastSend, CNode::nPingNonceSent, CNode::nPingUsecStart, CNode::nVersion, CNode::PushAddress(), PushGetBlocks(), CNode::PushMessage(), CNode::setAddrKnown, CNode::setInventoryKnown, CChain::Tip(), CService::ToString(), CInv::ToString(), base_uint< BITS >::ToString(), TRY_LOCK, CInv::type, CNode::vAddrToSend, CNode::vInventoryToSend, vNodes, and CNode::vSendMsg.
Referenced by RegisterNodeSignals(), and UnregisterNodeSignals().
void SyncWithWallets | ( | const uint256 & | hash, |
const CTransaction & | tx, | ||
const CBlock * | pblock = NULL |
||
) |
Push an updated transaction to all registered wallets.
Definition at line 187 of file main.cpp.
References g_signals.
Referenced by ConnectTip(), DisconnectTip(), and sendrawtransaction().
void ThreadScriptCheck | ( | ) |
Run an instance of the script checking thread.
Definition at line 1753 of file main.cpp.
References RenameThread(), and scriptcheckqueue.
Referenced by AppInit2().
void UnloadBlockIndex | ( | ) |
Unload database information.
Definition at line 2997 of file main.cpp.
References CChain::SetTip().
Referenced by AppInit2().
void UnregisterAllWallets | ( | ) |
Unregister all wallets from core.
Definition at line 178 of file main.cpp.
References g_signals.
Referenced by Shutdown().
void UnregisterNodeSignals | ( | CNodeSignals & | nodeSignals | ) |
Unregister a network node.
Definition at line 345 of file main.cpp.
References CNodeSignals::FinalizeNode, CNodeSignals::GetHeight, mastercore::GetHeight(), CNodeSignals::InitializeNode, CNodeSignals::ProcessMessages, ProcessMessages(), CNodeSignals::SendMessages, and SendMessages().
Referenced by Shutdown().
void UnregisterWallet | ( | CWalletInterface * | pwalletIn | ) |
Unregister a wallet from core.
Definition at line 169 of file main.cpp.
References CWalletInterface::EraseFromWallet(), g_signals, CWalletInterface::Inventory(), CWalletInterface::ResendWalletTransactions(), CWalletInterface::SetBestChain(), CWalletInterface::SyncTransaction(), and CWalletInterface::UpdatedTransaction().
void UpdateCoins | ( | const CTransaction & | tx, |
CValidationState & | state, | ||
CCoinsViewCache & | inputs, | ||
CTxUndo & | txundo, | ||
int | nHeight, | ||
const uint256 & | txhash | ||
) |
Definition at line 1518 of file main.cpp.
References CCoinsViewCache::GetCoins(), COutPoint::hash, CTransaction::IsCoinBase(), CTxIn::prevout, CCoinsViewCache::SetCoins(), CCoins::Spend(), CTransaction::vin, and CTxUndo::vprevout.
Referenced by ConnectBlock(), and CreateNewBlock().
void UpdateTime | ( | CBlockHeader & | block, |
const CBlockIndex * | pindexPrev | ||
) |
Definition at line 1499 of file main.cpp.
References GetAdjustedTime(), CBlockIndex::GetMedianTimePast(), GetNextWorkRequired(), CBlockHeader::nBits, CBlockHeader::nTime, and TestNet().
Referenced by CreateNewBlock(), and getblocktemplate().
Verify consistency of the block and coin databases.
Definition at line 2923 of file main.cpp.
References CheckBlock(), ConnectBlock(), DisconnectBlock(), error(), CBlockIndex::GetBlockHash(), CCoinsViewCache::GetCacheSize(), CBlockIndex::GetUndoPos(), CChain::Height(), CDiskBlockPos::IsNull(), LOCK, LogPrintf, nCoinCacheSize, CChain::Next(), CBlockIndex::nHeight, CBlockIndex::pprev, ReadBlockFromDisk(), CChain::Tip(), base_uint< BITS >::ToString(), and CBlock::vtx.
Referenced by AppInit2(), and verifychain().
bool VerifySignature | ( | const CCoins & | txFrom, |
const CTransaction & | txTo, | ||
unsigned int | nIn, | ||
unsigned int | flags, | ||
int | nHashType | ||
) |
bool WriteBlockToDisk | ( | CBlock & | block, |
CDiskBlockPos & | pos | ||
) |
Functions for disk access for blocks.
Definition at line 1119 of file main.cpp.
References CLIENT_VERSION, error(), FileCommit(), fileout, FLATDATA, CAutoFile::GetSerializeSize(), IsInitialBlockDownload(), CDiskBlockPos::nPos, OpenBlockFile(), Params(), and SER_DISK.
Referenced by AcceptBlock(), and InitBlockIndex().
|
static |
Timeout in seconds before considering a block download peer unresponsive.
Definition at line 68 of file main.h.
Referenced by SendMessages().
|
static |
The pre-allocation chunk size for blk?????.dat files (since 0.8)
Definition at line 54 of file main.h.
Referenced by FindBlockPos().
CChain chainActive |
The currently-connected chain of blocks.
Definition at line 48 of file main.cpp.
Referenced by AppInit2(), blockToJSON(), mastercore::checkExpiredAlerts(), CreateNewBlock(), dumpwallet(), mastercore::eraseMaxedCrowdsale(), TransactionDesc::FormatTxStatus(), getbestblockhash(), getblockchaininfo(), getblockcount(), getblockhash(), getblocktemplate(), CMPMetaDEx::getBlockTime(), GetDifficulty(), mastercore::GetHeight(), getinfo(), getinfo_MP(), CWallet::GetKeyBirthTimes(), ClientModel::getLastBlockDate(), mastercore::GetLatestBlockTime(), getmininginfo(), GetNetworkHashPS(), ClientModel::getNumBlocks(), getrawmempool(), ClientModel::getVerificationProgress(), importprivkey(), importwallet(), CMPTransaction::interpretPacket(), listblocktransactions_MP(), listsinceblock(), load_most_relevant_state(), CMPTransaction::logicMath_ChangeIssuer(), CMPTransaction::logicMath_GrantTokens(), CMPTransaction::logicMath_RevokeTokens(), msc_initial_scan(), WalletModel::pollBalanceChanged(), CWallet::ScanForWalletTransactions(), CMPTxList::setLastAlert(), Shutdown(), TransactionRecord::statusUpdateNeeded(), TxToJSON(), and TransactionRecord::updateStatus().
CChain chainMostWork |
CScript COINBASE_FLAGS |
Definition at line 80 of file main.cpp.
Referenced by getblocktemplate(), and IncrementExtraNonce().
|
static |
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
Definition at line 58 of file main.h.
Referenced by CheckInputs(), CMerkleTx::GetBlocksToMaturity(), and TransactionDesc::toHTML().
CCriticalSection cs_main |
Definition at line 43 of file main.cpp.
Referenced by CWallet::AddReserveKey(), CWallet::AvailableCoins(), CWallet::CommitTransaction(), CreateNewBlock(), TransactionTablePriv::describe(), CRPCTable::execute(), TransactionDesc::FormatTxStatus(), CWallet::GetAllReserveKeys(), CWallet::GetBalance(), mastercore::GetHeight(), CWallet::GetImmatureBalance(), ClientModel::getLastBlockDate(), mastercore::GetLatestBlockTime(), ClientModel::getNumBlocks(), WalletModel::getOutputs(), CWallet::GetUnconfirmedBalance(), ClientModel::getVerificationProgress(), importprivkey(), TransactionTablePriv::index(), WalletModel::isLockedCoin(), WalletModel::isSpent(), WalletModel::listCoins(), WalletModel::listLockedCoins(), WalletModel::lockCoin(), WalletModel::pollBalanceChanged(), WalletModel::prepareTransaction(), CWallet::ReacceptWalletTransactions(), TransactionTablePriv::refreshWallet(), CWallet::ScanForWalletTransactions(), WalletModel::sendCoins(), Shutdown(), TransactionRecord::statusUpdateNeeded(), CWallet::SyncTransaction(), TransactionDesc::toHTML(), WalletModel::unlockCoin(), TransactionRecord::updateStatus(), ClientModel::updateTimer(), and TransactionTablePriv::updateWallet().
|
static |
Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create.
Definition at line 39 of file main.h.
Referenced by CreateNewBlock(), and HelpMessage().
|
static |
Definition at line 40 of file main.h.
Referenced by CreateNewBlock().
|
static |
Default for -blockprioritysize, maximum space for zero/low-fee transactions.
Definition at line 42 of file main.h.
Referenced by CreateNewBlock(), GetMinFee(), and HelpMessage().
|
static |
Default for -maxorphanblocks, maximum number of orphan blocks kept in memory.
Definition at line 50 of file main.h.
Referenced by HelpMessage(), and PruneOrphanBlocks().
|
static |
Default for -maxorphantx, maximum number of orphan transactions kept in memory.
Definition at line 48 of file main.h.
Referenced by HelpMessage(), and ProcessMessage().
|
static |
-par default (number of script-checking threads, 0 = auto)
Definition at line 64 of file main.h.
Referenced by AppInit2(), HelpMessage(), and OptionsModel::Init().
bool fBenchmark |
Definition at line 54 of file main.cpp.
Referenced by AppInit2(), ConnectBlock(), ConnectTip(), and DisconnectTip().
bool fImporting |
Definition at line 52 of file main.cpp.
Referenced by CImportingNow::CImportingNow(), ClientModel::getBlockSource(), IsInitialBlockDownload(), ProcessMessage(), SendMessages(), ClientModel::updateTimer(), and CImportingNow::~CImportingNow().
bool fReindex |
Definition at line 53 of file main.cpp.
Referenced by AppInit2(), DisconnectTip(), ClientModel::getBlockSource(), InitBlockIndex(), IsInitialBlockDownload(), LoadBlockIndex(), LoadBlockIndexDB(), mastercore_init(), ProcessMessage(), SendMessages(), ThreadImport(), and ClientModel::updateTimer().
bool fTxIndex |
Definition at line 55 of file main.cpp.
Referenced by AppInit2(), ConnectBlock(), GetTransaction(), InitBlockIndex(), and LoadBlockIndexDB().
|
static |
Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
Definition at line 60 of file main.h.
Referenced by TransactionDesc::FormatTxStatus(), IsFinalTx(), and TransactionRecord::updateStatus().
std::map<uint256, CBlockIndex*> mapBlockIndex |
Definition at line 47 of file main.cpp.
Referenced by CWallet::AddToWallet(), AppInit2(), getactivecrowdsales_MP(), getblock(), getcrowdsale_MP(), CWallet::GetKeyBirthTimes(), CCoinsViewDB::GetStats(), gettxout(), listsinceblock(), listtransactions_MP(), load_most_relevant_state(), populateRPCTransactionObject(), prune_state_files(), TxToJSON(), TransactionRecord::updateStatus(), and WalletTxToJSON().
|
static |
The maximum allowed number of signature check operations in a block (network rule)
Definition at line 46 of file main.h.
Referenced by CheckBlock(), ConnectBlock(), CreateNewBlock(), and getblocktemplate().
|
static |
The maximum allowed size for a serialized block, in bytes (network rule)
Definition at line 37 of file main.h.
Referenced by CheckBlock(), CheckTransaction(), CreateNewBlock(), CPartialMerkleTree::ExtractMatches(), getblocktemplate(), and LoadExternalBlockFile().
|
static |
The maximum size of a blk?????.dat file (since 0.8)
Definition at line 52 of file main.h.
Referenced by FindBlockPos().
|
static |
Number of blocks that can be requested at any given time from a single peer.
Definition at line 66 of file main.h.
Referenced by SendMessages().
|
static |
Maximum number of script-checking threads allowed.
Definition at line 62 of file main.h.
Referenced by AppInit2(), HelpMessage(), and OptionsDialog::OptionsDialog().
|
static |
The maximum size for transactions we're willing to relay/mine.
Definition at line 44 of file main.h.
Referenced by IsStandardTx().
CTxMemPool mempool |
Definition at line 45 of file main.cpp.
Referenced by AppInit2(), CreateNewBlock(), getblocktemplate(), getmininginfo(), getrawmempool(), gettxout(), CWallet::ReacceptWalletTransactions(), sendrawtransaction(), Shutdown(), and signrawtransaction().
unsigned int nCoinCacheSize |
Definition at line 56 of file main.cpp.
Referenced by AppInit2(), VerifyDB(), and WriteChainState().
uint64_t nLastBlockSize |
Definition at line 81 of file miner.cpp.
Referenced by CreateNewBlock(), and getmininginfo().
uint64_t nLastBlockTx |
Definition at line 80 of file miner.cpp.
Referenced by CreateNewBlock(), and getmininginfo().
|
static |
Definition at line 103 of file main.h.
Referenced by CheckDiskSpace().
int nScriptCheckThreads |
Definition at line 51 of file main.cpp.
Referenced by AppInit2().
int64_t nTimeBestReceived |
Definition at line 50 of file main.cpp.
Referenced by CWallet::ResendWalletTransactions(), and UpdateTip().
CBlockTreeDB* pblocktree |
Global variable that points to the active block tree (protected by cs_main)
Definition at line 414 of file main.cpp.
Referenced by AppInit2(), Shutdown(), and ThreadImport().
CCoinsViewCache* pcoinsTip |
Global variable that points to the active CCoinsView (protected by cs_main)
Definition at line 413 of file main.cpp.
Referenced by AppInit2(), CreateNewBlock(), GetTransaction(), gettxout(), gettxoutsetinfo(), sendrawtransaction(), Shutdown(), signrawtransaction(), and TransactionDesc::toHTML().
|
static |
Definition at line 84 of file main.h.
Referenced by AcceptBlock(), and ProcessBlock().
|
static |
Definition at line 80 of file main.h.
Referenced by AcceptToMemoryPool(), and ProcessMessage().
|
static |
Definition at line 83 of file main.h.
Referenced by AcceptToMemoryPool().
|
static |
Definition at line 78 of file main.h.
Referenced by AcceptBlock(), AcceptToMemoryPool(), CheckBlock(), CheckInputs(), CheckTransaction(), ConnectBlock(), and ProcessBlock().
|
static |
|
static |
Definition at line 81 of file main.h.
Referenced by AcceptToMemoryPool(), and CheckInputs().
|
static |
Definition at line 79 of file main.h.
Referenced by AcceptBlock(), and ProcessMessage().
const std::string strMessageMagic |
Definition at line 82 of file main.cpp.
Referenced by SignVerifyMessageDialog::on_signMessageButton_SM_clicked(), SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked(), signmessage(), and verifymessage().
|
static |
The pre-allocation chunk size for rev?????.dat files (since 0.8)
Definition at line 56 of file main.h.
Referenced by FindUndoPos().