![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <chain.h>
Public Member Functions | |
CBlockIndex * | Genesis () const |
CBlockIndex * | Tip () const |
CBlockIndex * | operator[] (int nHeight) const |
bool | Contains (const CBlockIndex *pindex) const |
CBlockIndex * | Next (const CBlockIndex *pindex) const |
int | Height () const |
void | SetTip (CBlockIndex *pindex) |
CBlockLocator | GetLocator (const CBlockIndex *pindex=NULL) const |
const CBlockIndex * | FindFork (const CBlockIndex *pindex) const |
Private Attributes | |
std::vector< CBlockIndex * > | vChain |
Friends | |
bool | operator== (const CChain &a, const CChain &b) |
|
inline |
Efficiently check whether a block is present in this chain.
Definition at line 384 of file chain.h.
Referenced by blockheaderToJSON(), blockToJSON(), FindForkInGlobalIndex(), FindMostWorkChain(), getchaintips(), CMerkleTx::GetDepthInMainChain(), CWallet::GetKeyBirthTimes(), InvalidateBlock(), CGovernanceObject::IsCollateralValid(), CWallet::MarkConflicted(), Next(), ProcessGetData(), ProcessMessage(), rest_headers(), CMerkleTx::SetMerkleBranch(), TestLockPointValidity(), TxToJSON(), and verifytxoutproof().
const CBlockIndex * CChain::FindFork | ( | const CBlockIndex * | pindex | ) | const |
Find the last common block between this chain and a block index entry.
Definition at line 53 of file chain.cpp.
Referenced by ActivateBestChain(), ActivateBestChainStep(), and getchaintips().
|
inline |
Returns the index entry for the genesis block of this chain, or NULL if none.
Definition at line 361 of file chain.h.
Referenced by AppInit2(), CheckBlockIndex(), FindForkInGlobalIndex(), importaddress(), importprivkey(), importpubkey(), and InitBlockIndex().
CBlockLocator CChain::GetLocator | ( | const CBlockIndex * | pindex = NULL | ) | const |
Return a CBlockLocator that refers to a block in this chain (by default the tip).
Definition at line 25 of file chain.cpp.
Referenced by AppInit2(), FlushStateToDisk(), ProcessMessage(), and SendMessages().
|
inline |
Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1.
Definition at line 397 of file chain.h.
Referenced by AcceptBlock(), AcceptToMemoryPoolWorker(), AppInit2(), blockheaderToJSON(), blockToJSON(), CMasternode::Check(), CMasternodePing::CheckAndUpdate(), CheckBlockIndex(), CheckFinalTx(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), CMasternodeBroadcast::CheckOutpoint(), CMasternodePing::CMasternodePing(), CWallet::CreateTransaction(), dumpwallet(), TransactionDesc::FormatTxStatus(), generate(), getblockchaininfo(), getblockcount(), getblockhash(), GetBlockHash(), CMerkleTx::GetDepthInMainChain(), getgovernanceinfo(), getinfo(), CWallet::GetKeyBirthTimes(), getmininginfo(), GetNetworkHashPS(), ClientModel::getNumBlocks(), gettxoutproof(), GetUTXOConfirmations(), importelectrumwallet(), importwallet(), InvalidChainFound(), CGovernanceObject::IsCollateralValid(), CTxLockRequest::IsValid(), listsinceblock(), LoadBlockIndexDB(), CWallet::MarkConflicted(), mempoolToJSON(), WalletModel::pollBalanceChanged(), CSporkManager::ProcessSpork(), rest_getutxos(), CMerkleTx::SetMerkleBranch(), TransactionRecord::statusUpdateNeeded(), TxToJSON(), TransactionRecord::updateStatus(), UpdateTip(), and CVerifyDB::VerifyDB().
|
inline |
Find the successor of a block in this chain, or NULL if the given index is not found or is the tip.
Definition at line 389 of file chain.h.
Referenced by blockheaderToJSON(), blockToJSON(), getblockheaders(), ProcessMessage(), rest_headers(), CWallet::ScanForWalletTransactions(), and CVerifyDB::VerifyDB().
|
inline |
void CChain::SetTip | ( | CBlockIndex * | pindex | ) |
Set/initialize a chain with a given tip.
CChain implementation
Definition at line 13 of file chain.cpp.
Referenced by LoadBlockIndexDB(), UnloadBlockIndex(), and UpdateTip().
|
inline |
Returns the index entry for the tip of this chain, or NULL if none.
Definition at line 366 of file chain.h.
Referenced by AcceptBlock(), AcceptToMemoryPoolWorker(), ActivateBestChain(), ActivateBestChainStep(), AlreadyHave(), AppInit2(), BitcoinMiner(), CheckBlockIndex(), CheckFinalTx(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), CheckSequenceLocks(), CMasternodePing::CMasternodePing(), ConnectTip(), CreateNewBlock(), DisconnectTip(), dumpwallet(), FindFilesToPrune(), generate(), getbestblockhash(), getblockchaininfo(), GetBlockHash(), getblocktemplate(), getchaintips(), GetDifficulty(), ClientModel::getLastBlockDate(), GetNetworkHashPS(), GetUTXOConfirmations(), ClientModel::getVerificationProgress(), importwallet(), CDSNotificationInterface::InitializeCurrentBlockTip(), InvalidateBlock(), InvalidChainFound(), IsInitialBlockDownload(), LoadBlockIndexDB(), masternode(), masternodelist(), ProcessBlockFound(), ProcessGetData(), ProcessMessage(), CSporkManager::ProcessSpork(), PruneBlockIndexCandidates(), ReceivedBlockTransactions(), ReconsiderBlock(), CMasternodePayments::RequestLowDataPaymentBlocks(), rest_getutxos(), CWallet::ScanForWalletTransactions(), SendMessages(), TestBlockValidity(), UpdateTip(), CVerifyDB::VerifyDB(), and VersionBitsTipState().
|
private |