Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | public: | ||||
//! Get block height above genesis block. Returns 0 for genesis block, | //! Get block height above genesis block. Returns 0 for genesis block, | ||||
//! 1 for following block, and so on. Returns nullopt for a block not | //! 1 for following block, and so on. Returns nullopt for a block not | ||||
//! included in the current chain. | //! included in the current chain. | ||||
virtual Optional<int> getBlockHeight(const BlockHash &hash) = 0; | virtual Optional<int> getBlockHeight(const BlockHash &hash) = 0; | ||||
//! Get block hash. Height must be valid or this function will abort. | //! Get block hash. Height must be valid or this function will abort. | ||||
virtual BlockHash getBlockHash(int height) = 0; | virtual BlockHash getBlockHash(int height) = 0; | ||||
//! Get block time. Height must be valid or this function will abort. | |||||
virtual int64_t getBlockTime(int height) = 0; | |||||
//! Check that the block is available on disk (i.e. has not been | //! Check that the block is available on disk (i.e. has not been | ||||
//! pruned), and contains transactions. | //! pruned), and contains transactions. | ||||
virtual bool haveBlockOnDisk(int height) = 0; | virtual bool haveBlockOnDisk(int height) = 0; | ||||
//! Return height of the first block in the chain with timestamp equal | //! Return height of the first block in the chain with timestamp equal | ||||
//! or greater than the given time and height equal or greater than the | //! or greater than the given time and height equal or greater than the | ||||
//! given height, or nullopt if there is no block with a high enough | //! given height, or nullopt if there is no block with a high enough | ||||
//! timestamp and height. Also return the block hash as an optional | //! timestamp and height. Also return the block hash as an optional | ||||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |