Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | public: | ||||
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. | //! Get block time. Height must be valid or this function will abort. | ||||
virtual int64_t getBlockTime(int height) = 0; | virtual int64_t getBlockTime(int height) = 0; | ||||
//! Get block median time past. Height must be valid or this function | |||||
//! will abort. | |||||
virtual int64_t getBlockMedianTimePast(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 214 Lines • Show Last 20 Lines |