Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | public: | ||||
//! Find first block in the chain with timestamp >= the given time | //! Find first block in the chain with timestamp >= the given time | ||||
//! and height >= than the given height, return false if there is no block | //! and height >= than the given height, return false if there is no block | ||||
//! with a high enough timestamp and height. Optionally return block | //! with a high enough timestamp and height. Optionally return block | ||||
//! information. | //! information. | ||||
virtual bool | virtual bool | ||||
findFirstBlockWithTimeAndHeight(int64_t min_time, int min_height, | findFirstBlockWithTimeAndHeight(int64_t min_time, int min_height, | ||||
const FoundBlock &block = {}) = 0; | const FoundBlock &block = {}) = 0; | ||||
//! Find next block if block is part of current chain. Also flag if | |||||
//! there was a reorg and the specified block hash is no longer in the | |||||
//! current chain, and optionally return block information. | |||||
virtual bool findNextBlock(const BlockHash &block_hash, int block_height, | |||||
const FoundBlock &next = {}, | |||||
bool *reorg = nullptr) = 0; | |||||
//! Find ancestor of block at specified height and optionally return | //! Find ancestor of block at specified height and optionally return | ||||
//! ancestor information. | //! ancestor information. | ||||
virtual bool findAncestorByHeight(const BlockHash &block_hash, | virtual bool findAncestorByHeight(const BlockHash &block_hash, | ||||
int ancestor_height, | int ancestor_height, | ||||
const FoundBlock &ancestor_out = {}) = 0; | const FoundBlock &ancestor_out = {}) = 0; | ||||
//! Return whether block descends from a specified ancestor, and | //! Return whether block descends from a specified ancestor, and | ||||
//! optionally return ancestor information. | //! optionally return ancestor information. | ||||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |