Changeset View
Changeset View
Standalone View
Standalone View
src/chain.h
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | CBlockHeader GetBlockHeader() const { | ||||
block.nTime = nTime; | block.nTime = nTime; | ||||
block.nBits = nBits; | block.nBits = nBits; | ||||
block.nNonce = nNonce; | block.nNonce = nNonce; | ||||
return block; | return block; | ||||
} | } | ||||
BlockHash GetBlockHash() const { return *phashBlock; } | BlockHash GetBlockHash() const { return *phashBlock; } | ||||
/** | |||||
* Check whether this block's and all previous blocks' transactions have | |||||
* been downloaded (and stored to disk) at some point. | |||||
* | |||||
* Does not imply the transactions are consensus-valid (ConnectTip might | |||||
* fail) Does not imply the transactions are still stored on disk. | |||||
* (IsBlockPruned might return true) | |||||
*/ | |||||
bool HaveTxsDownloaded() const { return nChainTx != 0; } | |||||
int64_t GetBlockTime() const { return int64_t(nTime); } | int64_t GetBlockTime() const { return int64_t(nTime); } | ||||
int64_t GetBlockTimeMax() const { return int64_t(nTimeMax); } | int64_t GetBlockTimeMax() const { return int64_t(nTimeMax); } | ||||
int64_t GetHeaderReceivedTime() const { return nTimeReceived; } | int64_t GetHeaderReceivedTime() const { return nTimeReceived; } | ||||
int64_t GetReceivedTimeDiff() const { | int64_t GetReceivedTimeDiff() const { | ||||
return GetHeaderReceivedTime() - GetBlockTime(); | return GetHeaderReceivedTime() - GetBlockTime(); | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |