Bitcoin
Public Member Functions | List of all members
interfaces::anonymous_namespace{chain.cpp}::ChainImpl Class Reference
Inheritance diagram for interfaces::anonymous_namespace{chain.cpp}::ChainImpl:
interfaces::Chain

Public Member Functions

std::unique_ptr< Chain::Locklock (bool try_lock) override
 
bool findBlock (const uint256 &hash, CBlock *block, int64_t *time, int64_t *time_max) override
 
void findCoins (std::map< COutPoint, Coin > &coins) override
 
double guessVerificationProgress (const uint256 &block_hash) override
 
RBFTransactionState isRBFOptIn (const CTransaction &tx) override
 Check if transaction is RBF opt in. More...
 
bool hasDescendantsInMempool (const uint256 &txid) override
 Check if transaction has descendants in mempool. More...
 
void relayTransaction (const uint256 &txid) override
 Relay transaction. More...
 
void getTransactionAncestry (const uint256 &txid, size_t &ancestors, size_t &descendants) override
 Calculate mempool ancestor and descendant counts for the given transaction. More...
 
bool checkChainLimits (const CTransactionRef &tx) override
 Check if transaction will pass the mempool's chain limits. More...
 
CFeeRate estimateSmartFee (int num_blocks, bool conservative, FeeCalculation *calc) override
 Estimate smart fee. More...
 
unsigned int estimateMaxBlocks () override
 Fee estimator max target. More...
 
CFeeRate mempoolMinFee () override
 Mempool minimum fee. More...
 
CFeeRate relayMinFee () override
 Relay current minimum fee (from -minrelaytxfee and -incrementalrelayfee settings). More...
 
CFeeRate relayIncrementalFee () override
 Relay incremental fee setting (-incrementalrelayfee), reflecting cost of relay. More...
 
CFeeRate relayDustFee () override
 Relay dust fee setting (-dustrelayfee), reflecting lowest rate it's economical to spend. More...
 
bool havePruned () override
 Check if any block has been pruned. More...
 
bool p2pEnabled () override
 Check if p2p enabled. More...
 
bool isReadyToBroadcast () override
 Check if the node is ready to broadcast transactions. More...
 
bool isInitialBlockDownload () override
 Check if in IBD. More...
 
bool shutdownRequested () override
 Check if shutdown requested. More...
 
int64_t getAdjustedTime () override
 Get adjusted time. More...
 
void initMessage (const std::string &message) override
 Send init message. More...
 
void initWarning (const std::string &message) override
 Send init warning. More...
 
void initError (const std::string &message) override
 Send init error. More...
 
void loadWallet (std::unique_ptr< Wallet > wallet) override
 Send wallet load notification to the GUI. More...
 
void showProgress (const std::string &title, int progress, bool resume_possible) override
 Send progress indicator. More...
 
std::unique_ptr< HandlerhandleNotifications (Notifications &notifications) override
 Register handler for notifications. More...
 
void waitForNotificationsIfNewBlocksConnected (const uint256 &old_tip) override
 
std::unique_ptr< HandlerhandleRpc (const CRPCCommand &command) override
 
bool rpcEnableDeprecated (const std::string &method) override
 Check if deprecated RPC is enabled. More...
 
void rpcRunLater (const std::string &name, std::function< void()> fn, int64_t seconds) override
 Run function after given number of seconds. Cancel any previous calls with same name. More...
 
int rpcSerializationFlags () override
 Current RPC serialization flags. More...
 
void requestMempoolTransactions (Notifications &notifications) override
 
- Public Member Functions inherited from interfaces::Chain
virtual ~Chain ()
 

Member Function Documentation

◆ checkChainLimits()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::checkChainLimits ( const CTransactionRef tx)
inlineoverridevirtual

Check if transaction will pass the mempool's chain limits.

Implements interfaces::Chain.

◆ estimateMaxBlocks()

unsigned int interfaces::anonymous_namespace{chain.cpp}::ChainImpl::estimateMaxBlocks ( )
inlineoverridevirtual

Fee estimator max target.

Implements interfaces::Chain.

◆ estimateSmartFee()

CFeeRate interfaces::anonymous_namespace{chain.cpp}::ChainImpl::estimateSmartFee ( int  num_blocks,
bool  conservative,
FeeCalculation calc 
)
inlineoverridevirtual

Estimate smart fee.

Implements interfaces::Chain.

◆ findBlock()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::findBlock ( const uint256 hash,
CBlock block,
int64_t time,
int64_t max_time 
)
inlineoverridevirtual

Return whether node has the block and optionally return block metadata or contents.

If a block pointer is provided to retrieve the block contents, and the block exists but doesn't have data (for example due to pruning), the block will be empty and all fields set to null.

Implements interfaces::Chain.

◆ findCoins()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::findCoins ( std::map< COutPoint, Coin > &  coins)
inlineoverridevirtual

Look up unspent output information. Returns coins in the mempool and in the current chain UTXO set. Iterates through all the keys in the map and populates the values.

Implements interfaces::Chain.

◆ getAdjustedTime()

int64_t interfaces::anonymous_namespace{chain.cpp}::ChainImpl::getAdjustedTime ( )
inlineoverridevirtual

Get adjusted time.

Implements interfaces::Chain.

◆ getTransactionAncestry()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::getTransactionAncestry ( const uint256 txid,
size_t &  ancestors,
size_t &  descendants 
)
inlineoverridevirtual

Calculate mempool ancestor and descendant counts for the given transaction.

Implements interfaces::Chain.

◆ guessVerificationProgress()

double interfaces::anonymous_namespace{chain.cpp}::ChainImpl::guessVerificationProgress ( const uint256 block_hash)
inlineoverridevirtual

Estimate fraction of total transactions verified if blocks up to the specified block hash are verified.

Implements interfaces::Chain.

◆ handleNotifications()

std::unique_ptr<Handler> interfaces::anonymous_namespace{chain.cpp}::ChainImpl::handleNotifications ( Notifications notifications)
inlineoverridevirtual

Register handler for notifications.

Implements interfaces::Chain.

◆ handleRpc()

std::unique_ptr<Handler> interfaces::anonymous_namespace{chain.cpp}::ChainImpl::handleRpc ( const CRPCCommand command)
inlineoverridevirtual

Register handler for RPC. Command is not copied, so reference needs to remain valid until Handler is disconnected.

Implements interfaces::Chain.

◆ hasDescendantsInMempool()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::hasDescendantsInMempool ( const uint256 txid)
inlineoverridevirtual

Check if transaction has descendants in mempool.

Implements interfaces::Chain.

◆ havePruned()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::havePruned ( )
inlineoverridevirtual

Check if any block has been pruned.

Implements interfaces::Chain.

◆ initError()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::initError ( const std::string &  message)
inlineoverridevirtual

Send init error.

Implements interfaces::Chain.

◆ initMessage()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::initMessage ( const std::string &  message)
inlineoverridevirtual

Send init message.

Implements interfaces::Chain.

◆ initWarning()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::initWarning ( const std::string &  message)
inlineoverridevirtual

Send init warning.

Implements interfaces::Chain.

◆ isInitialBlockDownload()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::isInitialBlockDownload ( )
inlineoverridevirtual

Check if in IBD.

Implements interfaces::Chain.

◆ isRBFOptIn()

RBFTransactionState interfaces::anonymous_namespace{chain.cpp}::ChainImpl::isRBFOptIn ( const CTransaction tx)
inlineoverridevirtual

Check if transaction is RBF opt in.

Implements interfaces::Chain.

◆ isReadyToBroadcast()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::isReadyToBroadcast ( )
inlineoverridevirtual

Check if the node is ready to broadcast transactions.

Implements interfaces::Chain.

◆ loadWallet()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::loadWallet ( std::unique_ptr< Wallet wallet)
inlineoverridevirtual

Send wallet load notification to the GUI.

Implements interfaces::Chain.

◆ lock()

std::unique_ptr<Chain::Lock> interfaces::anonymous_namespace{chain.cpp}::ChainImpl::lock ( bool  try_lock)
inlineoverridevirtual

Return Lock interface. Chain is locked when this is called, and unlocked when the returned interface is freed.

Implements interfaces::Chain.

◆ mempoolMinFee()

CFeeRate interfaces::anonymous_namespace{chain.cpp}::ChainImpl::mempoolMinFee ( )
inlineoverridevirtual

Mempool minimum fee.

Implements interfaces::Chain.

◆ p2pEnabled()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::p2pEnabled ( )
inlineoverridevirtual

Check if p2p enabled.

Implements interfaces::Chain.

◆ relayDustFee()

CFeeRate interfaces::anonymous_namespace{chain.cpp}::ChainImpl::relayDustFee ( )
inlineoverridevirtual

Relay dust fee setting (-dustrelayfee), reflecting lowest rate it's economical to spend.

Implements interfaces::Chain.

◆ relayIncrementalFee()

CFeeRate interfaces::anonymous_namespace{chain.cpp}::ChainImpl::relayIncrementalFee ( )
inlineoverridevirtual

Relay incremental fee setting (-incrementalrelayfee), reflecting cost of relay.

Implements interfaces::Chain.

◆ relayMinFee()

CFeeRate interfaces::anonymous_namespace{chain.cpp}::ChainImpl::relayMinFee ( )
inlineoverridevirtual

Relay current minimum fee (from -minrelaytxfee and -incrementalrelayfee settings).

Implements interfaces::Chain.

◆ relayTransaction()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::relayTransaction ( const uint256 txid)
inlineoverridevirtual

Relay transaction.

Implements interfaces::Chain.

◆ requestMempoolTransactions()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::requestMempoolTransactions ( Notifications notifications)
inlineoverridevirtual

Synchronously send TransactionAddedToMempool notifications about all current mempool transactions to the specified handler and return after the last one is sent. These notifications aren't coordinated with async notifications sent by handleNotifications, so out of date async notifications from handleNotifications can arrive during and after synchronous notifications from requestMempoolTransactions. Clients need to be prepared to handle this by ignoring notifications about unknown removed transactions and already added new transactions.

Implements interfaces::Chain.

◆ rpcEnableDeprecated()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::rpcEnableDeprecated ( const std::string &  method)
inlineoverridevirtual

Check if deprecated RPC is enabled.

Implements interfaces::Chain.

◆ rpcRunLater()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::rpcRunLater ( const std::string &  name,
std::function< void()>  fn,
int64_t  seconds 
)
inlineoverridevirtual

Run function after given number of seconds. Cancel any previous calls with same name.

Implements interfaces::Chain.

◆ rpcSerializationFlags()

int interfaces::anonymous_namespace{chain.cpp}::ChainImpl::rpcSerializationFlags ( )
inlineoverridevirtual

Current RPC serialization flags.

Implements interfaces::Chain.

◆ showProgress()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::showProgress ( const std::string &  title,
int  progress,
bool  resume_possible 
)
inlineoverridevirtual

Send progress indicator.

Implements interfaces::Chain.

◆ shutdownRequested()

bool interfaces::anonymous_namespace{chain.cpp}::ChainImpl::shutdownRequested ( )
inlineoverridevirtual

Check if shutdown requested.

Implements interfaces::Chain.

◆ waitForNotificationsIfNewBlocksConnected()

void interfaces::anonymous_namespace{chain.cpp}::ChainImpl::waitForNotificationsIfNewBlocksConnected ( const uint256 old_tip)
inlineoverridevirtual

Wait for pending notifications to be processed unless block hash points to the current chain tip, or to a possible descendant of the current chain tip that isn't currently connected.

Implements interfaces::Chain.


The documentation for this class was generated from the following file: