diff options
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main.h b/src/main.h index 60e733b23a..ba353a885b 100644 --- a/src/main.h +++ b/src/main.h @@ -165,10 +165,8 @@ bool IsInitialBlockDownload(); std::string GetWarnings(std::string strFor); /** Retrieve a transaction (from memory pool, or from disk, if possible) */ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false); -/** Connect/disconnect blocks until pindexNew is the new tip of the active block chain */ -bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew); /** Find the best known block, and make it the tip of the block chain */ -bool ConnectBestBlock(CValidationState &state); +bool ActivateBestChain(CValidationState &state); int64_t GetBlockValue(int nHeight, int64_t nFees); unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock); @@ -716,6 +714,8 @@ public: unsigned int nBits; unsigned int nNonce; + // (memory only) Sequencial id assigned to distinguish order in which blocks are received. + uint32_t nSequenceId; CBlockIndex() { @@ -729,6 +729,7 @@ public: nTx = 0; nChainTx = 0; nStatus = 0; + nSequenceId = 0; nVersion = 0; hashMerkleRoot = 0; @@ -749,6 +750,7 @@ public: nTx = 0; nChainTx = 0; nStatus = 0; + nSequenceId = 0; nVersion = block.nVersion; hashMerkleRoot = block.hashMerkleRoot; @@ -958,23 +960,23 @@ public: AbortNode(msg); return Error(); } - bool IsValid() { + bool IsValid() const { return mode == MODE_VALID; } - bool IsInvalid() { + bool IsInvalid() const { return mode == MODE_INVALID; } - bool IsError() { + bool IsError() const { return mode == MODE_ERROR; } - bool IsInvalid(int &nDoSOut) { + bool IsInvalid(int &nDoSOut) const { if (IsInvalid()) { nDoSOut = nDoS; return true; } return false; } - bool CorruptionPossible() { + bool CorruptionPossible() const { return corruptionPossible; } unsigned char GetRejectCode() const { return chRejectCode; } @@ -1041,6 +1043,8 @@ public: /** The currently-connected chain of blocks. */ extern CChain chainActive; +/** The currently best known chain of headers (some of which may be invalid). */ +extern CChain chainMostWork; /** Global variable that points to the active CCoinsView (protected by cs_main) */ extern CCoinsViewCache *pcoinsTip; |