Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_INTERFACES_CHAIN_H | #ifndef BITCOIN_INTERFACES_CHAIN_H | ||||
#define BITCOIN_INTERFACES_CHAIN_H | #define BITCOIN_INTERFACES_CHAIN_H | ||||
#include <optional.h> | #include <optional.h> | ||||
#include <primitives/txid.h> | #include <primitives/txid.h> | ||||
#include <cstddef> | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
struct BlockHash; | struct BlockHash; | ||||
class CBlock; | class CBlock; | ||||
struct CBlockLocator; | struct CBlockLocator; | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | virtual bool findBlock(const BlockHash &hash, CBlock *block = nullptr, | ||||
int64_t *max_time = nullptr) = 0; | int64_t *max_time = nullptr) = 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; | ||||
//! 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; | ||||
//! Calculate mempool ancestor and descendant counts for the given | |||||
//! transaction. | |||||
virtual void getTransactionAncestry(const TxId &txid, size_t &ancestors, | |||||
size_t &descendants) = 0; | |||||
}; | }; | ||||
//! Interface to let node manage chain clients (wallets, or maybe tools for | //! Interface to let node manage chain clients (wallets, or maybe tools for | ||||
//! monitoring and analysis in the future). | //! monitoring and analysis in the future). | ||||
class ChainClient { | class ChainClient { | ||||
public: | public: | ||||
virtual ~ChainClient() {} | virtual ~ChainClient() {} | ||||
Show All 36 Lines |