Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | public: | ||||
//! 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 | ||||
//! output parameter (to avoid the cost of a second lookup in case this | //! output parameter (to avoid the cost of a second lookup in case this | ||||
//! information is needed.) | //! information is needed.) | ||||
virtual Optional<int> | virtual Optional<int> | ||||
findFirstBlockWithTimeAndHeight(int64_t time, int height, | findFirstBlockWithTimeAndHeight(int64_t time, int height, | ||||
BlockHash *hash) = 0; | BlockHash *hash) = 0; | ||||
//! Return height of last block in the specified range which is pruned, | |||||
//! or nullopt if no block in the range is pruned. Range is inclusive. | |||||
virtual Optional<int> | |||||
findPruned(int start_height = 0, | |||||
Optional<int> stop_height = nullopt) = 0; | |||||
//! Return height of the highest block on the chain that is an ancestor | //! Return height of the highest block on the chain that is an ancestor | ||||
//! of the specified block, or nullopt if no common ancestor is found. | //! of the specified block, or nullopt if no common ancestor is found. | ||||
//! Also return the height of the specified block as an optional output | //! Also return the height of the specified block as an optional output | ||||
//! parameter (to avoid the cost of a second hash lookup in case this | //! parameter (to avoid the cost of a second hash lookup in case this | ||||
//! information is desired). | //! information is desired). | ||||
virtual Optional<int> findFork(const BlockHash &hash, | virtual Optional<int> findFork(const BlockHash &hash, | ||||
Optional<int> *height) = 0; | Optional<int> *height) = 0; | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | public: | ||||
//! the current chain UTXO set. Iterates through all the keys in the map and | //! the current chain UTXO set. Iterates through all the keys in the map and | ||||
//! populates the values. | //! populates the values. | ||||
virtual void findCoins(std::map<COutPoint, Coin> &coins) = 0; | virtual void findCoins(std::map<COutPoint, Coin> &coins) = 0; | ||||
//! Estimate fraction of total transactions verified if blocks up to | //! Estimate fraction of total transactions verified if blocks up to | ||||
//! the specified block hash are verified. | //! the specified block hash are verified. | ||||
virtual double guessVerificationProgress(const BlockHash &block_hash) = 0; | virtual double guessVerificationProgress(const BlockHash &block_hash) = 0; | ||||
//! Return true if data is available for all blocks in the specified range | |||||
//! of blocks. This checks all blocks that are ancestors of block_hash in | |||||
//! the height range from min_height to max_height, inclusive. | |||||
virtual bool hasBlocks(const BlockHash &block_hash, int min_height = 0, | |||||
Optional<int> max_height = {}) = 0; | |||||
//! Check if transaction has descendants in mempool. | //! Check if transaction has descendants in mempool. | ||||
virtual bool hasDescendantsInMempool(const TxId &txid) = 0; | virtual bool hasDescendantsInMempool(const TxId &txid) = 0; | ||||
//! Transaction is added to memory pool, if the transaction fee is below the | //! Transaction is added to memory pool, if the transaction fee is below the | ||||
//! amount specified by max_tx_fee, and broadcast to all peers if relay is | //! amount specified by max_tx_fee, and broadcast to all peers if relay is | ||||
//! set to true. Return false if the transaction could not be added due to | //! set to true. Return false if the transaction could not be added due to | ||||
//! the fee or for another reason. | //! the fee or for another reason. | ||||
virtual bool broadcastTransaction(const Config &config, | virtual bool broadcastTransaction(const Config &config, | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |