5 #ifndef BITCOIN_INTERFACES_CHAIN_H 6 #define BITCOIN_INTERFACES_CHAIN_H 104 virtual bool haveBlockOnDisk(
int height) = 0;
125 virtual bool findFirstBlockWithTimeAndHeight(int64_t min_time,
int min_height,
const FoundBlock& block={}) = 0;
129 virtual bool findAncestorByHeight(
const uint256& block_hash,
int ancestor_height,
const FoundBlock& ancestor_out={}) = 0;
133 virtual bool findAncestorByHash(
const uint256& block_hash,
139 virtual bool findCommonAncestor(
const uint256& block_hash1,
148 virtual void findCoins(std::map<COutPoint, Coin>& coins) = 0;
152 virtual double guessVerificationProgress(
const uint256& block_hash) = 0;
157 virtual bool hasBlocks(
const uint256& block_hash,
int min_height = 0,
Optional<int> max_height = {}) = 0;
163 virtual bool hasDescendantsInMempool(
const uint256& txid) = 0;
171 std::string& err_string) = 0;
174 virtual void getTransactionAncestry(
const uint256& txid,
size_t& ancestors,
size_t& descendants) = 0;
179 virtual void getPackageLimits(
unsigned int& limit_ancestor_count,
unsigned int& limit_descendant_count) = 0;
188 virtual unsigned int estimateMaxBlocks() = 0;
191 virtual CFeeRate mempoolMinFee() = 0;
197 virtual CFeeRate relayIncrementalFee() = 0;
200 virtual CFeeRate relayDustFee() = 0;
203 virtual bool havePruned() = 0;
206 virtual bool isReadyToBroadcast() = 0;
209 virtual bool isInitialBlockDownload() = 0;
212 virtual bool shutdownRequested() = 0;
215 virtual int64_t getAdjustedTime() = 0;
218 virtual void initMessage(
const std::string& message) = 0;
227 virtual void showProgress(
const std::string& title,
int progress,
bool resume_possible) = 0;
243 virtual std::unique_ptr<Handler> handleNotifications(std::shared_ptr<Notifications> notifications) = 0;
247 virtual void waitForNotificationsIfTipChanged(
const uint256& old_tip) = 0;
251 virtual std::unique_ptr<Handler> handleRpc(
const CRPCCommand& command) = 0;
254 virtual bool rpcEnableDeprecated(
const std::string& method) = 0;
257 virtual void rpcRunLater(
const std::string&
name, std::function<
void()> fn, int64_t seconds) = 0;
260 virtual int rpcSerializationFlags() = 0;
266 virtual bool updateRwSetting(
const std::string& name,
const util::SettingsValue& value) = 0;
276 virtual void requestMempoolTransactions(
Notifications& notifications) = 0;
287 virtual void registerRpcs() = 0;
290 virtual bool verify() = 0;
293 virtual bool load() = 0;
296 virtual void start(
CScheduler& scheduler) = 0;
299 virtual void flush() = 0;
302 virtual void stop() = 0;
305 virtual void setMockTime(int64_t
time) = 0;
313 #endif // BITCOIN_INTERFACES_CHAIN_H std::shared_ptr< const CTransaction > CTransactionRef
Helper for findBlock to selectively return pieces of block data.
virtual void transactionRemovedFromMempool(const CTransactionRef &tx, MemPoolRemovalReason reason, uint64_t mempool_sequence)
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
virtual void transactionAddedToMempool(const CTransactionRef &tx, uint64_t mempool_sequence)
virtual void updatedBlockTip()
MemPoolRemovalReason
Reason why a transaction was removed from the mempool, this is passed to the notification signal...
std::unique_ptr< Chain > MakeChain(NodeContext &node)
Return implementation of Chain interface.
RBFTransactionState
The rbf state of unconfirmed transactions.
int64_t CAmount
Amount in satoshis (Can be negative)
FoundBlock & data(CBlock &data)
Read block data from disk.
virtual void blockDisconnected(const CBlock &block, int height)
virtual void blockConnected(const CBlock &block, int height)
NodeContext struct containing references to chain state and connection state.
const FoundBlock * m_next_block
FoundBlock & maxTime(int64_t &max_time)
Interface to let node manage chain clients (wallets, or maybe tools for monitoring and analysis in th...
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
virtual void chainStateFlushed(const CBlockLocator &locator)
Fee rate in satoshis per kilobyte: CAmount / kB.
FoundBlock & hash(uint256 &hash)
FoundBlock & inActiveChain(bool &in_active_chain)
Return whether block is in the active (most-work) chain.
FoundBlock & height(int &height)
The basic transaction that is broadcasted on the network and contained in blocks. ...
FoundBlock & mtpTime(int64_t &mtp_time)
Simple class for background tasks that should be run periodically or once "after a while"...
FoundBlock & nextBlock(const FoundBlock &next_block)
Return next block in the active chain if current block is in the active chain.
std::optional< T > Optional
Substitute for C++17 std::optional DEPRECATED use std::optional in new code.
FoundBlock & time(int64_t &time)