5 #ifndef BITCOIN_INTERFACES_CHAIN_H 6 #define BITCOIN_INTERFACES_CHAIN_H 103 virtual bool haveBlockOnDisk(
int height) = 0;
131 virtual bool findFirstBlockWithTimeAndHeight(int64_t min_time,
int min_height,
const FoundBlock& block={}) = 0;
136 virtual bool findNextBlock(
const uint256& block_hash,
int block_height,
const FoundBlock& next={},
bool* reorg=
nullptr) = 0;
140 virtual bool findAncestorByHeight(
const uint256& block_hash,
int ancestor_height,
const FoundBlock& ancestor_out={}) = 0;
144 virtual bool findAncestorByHash(
const uint256& block_hash,
150 virtual bool findCommonAncestor(
const uint256& block_hash1,
159 virtual void findCoins(std::map<COutPoint, Coin>& coins) = 0;
163 virtual double guessVerificationProgress(
const uint256& block_hash) = 0;
168 virtual bool hasBlocks(
const uint256& block_hash,
int min_height = 0,
Optional<int> max_height = {}) = 0;
174 virtual bool hasDescendantsInMempool(
const uint256& txid) = 0;
182 std::string& err_string) = 0;
185 virtual void getTransactionAncestry(
const uint256& txid,
size_t& ancestors,
size_t& descendants) = 0;
190 virtual void getPackageLimits(
unsigned int& limit_ancestor_count,
unsigned int& limit_descendant_count) = 0;
199 virtual unsigned int estimateMaxBlocks() = 0;
202 virtual CFeeRate mempoolMinFee() = 0;
208 virtual CFeeRate relayIncrementalFee() = 0;
211 virtual CFeeRate relayDustFee() = 0;
214 virtual bool havePruned() = 0;
217 virtual bool isReadyToBroadcast() = 0;
220 virtual bool isInitialBlockDownload() = 0;
223 virtual bool shutdownRequested() = 0;
226 virtual int64_t getAdjustedTime() = 0;
229 virtual void initMessage(
const std::string& message) = 0;
238 virtual void showProgress(
const std::string& title,
int progress,
bool resume_possible) = 0;
254 virtual std::unique_ptr<Handler> handleNotifications(std::shared_ptr<Notifications> notifications) = 0;
258 virtual void waitForNotificationsIfTipChanged(
const uint256& old_tip) = 0;
262 virtual std::unique_ptr<Handler> handleRpc(
const CRPCCommand& command) = 0;
265 virtual bool rpcEnableDeprecated(
const std::string& method) = 0;
268 virtual void rpcRunLater(
const std::string&
name, std::function<
void()> fn, int64_t seconds) = 0;
271 virtual int rpcSerializationFlags() = 0;
277 virtual bool updateRwSetting(
const std::string& name,
const util::SettingsValue& value) = 0;
287 virtual void requestMempoolTransactions(
Notifications& notifications) = 0;
298 virtual void registerRpcs() = 0;
301 virtual bool verify() = 0;
304 virtual bool load() = 0;
307 virtual void start(
CScheduler& scheduler) = 0;
310 virtual void flush() = 0;
313 virtual void stop() = 0;
316 virtual void setMockTime(int64_t
time) = 0;
324 #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.
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 & height(int &height)
The basic transaction that is broadcasted on the network and contained in blocks. ...
FoundBlock & mtpTime(int64_t &mtp_time)
boost::optional< T > Optional
Substitute for C++17 std::optional.
Simple class for background tasks that should be run periodically or once "after a while"...
FoundBlock & time(int64_t &time)