Bitcoin
Public Member Functions | Public Attributes | List of all members
interfaces::anonymous_namespace{node.cpp}::NodeImpl Class Reference
Inheritance diagram for interfaces::anonymous_namespace{node.cpp}::NodeImpl:
interfaces::Node

Public Member Functions

 NodeImpl ()
 
bool parseParameters (int argc, const char *const argv[], std::string &error) override
 Set command line arguments. More...
 
bool readConfigFiles (std::string &error) override
 Load settings from configuration file. More...
 
bool softSetArg (const std::string &arg, const std::string &value) override
 Set a command line argument if it doesn't already have a value. More...
 
bool softSetBoolArg (const std::string &arg, bool value) override
 Set a command line boolean argument if it doesn't already have a value. More...
 
void selectParams (const std::string &network) override
 Choose network parameters. More...
 
uint64_t getAssumedBlockchainSize () override
 Get the (assumed) blockchain size. More...
 
uint64_t getAssumedChainStateSize () override
 Get the (assumed) chain state size. More...
 
std::string getNetwork () override
 Get network name. More...
 
void initLogging () override
 Init logging. More...
 
void initParameterInteraction () override
 Init parameter interaction. More...
 
std::string getWarnings (const std::string &type) override
 Get warnings. More...
 
uint32_t getLogCategories () override
 
bool baseInitialize () override
 Initialize app dependencies. More...
 
bool appInitMain () override
 Start node. More...
 
void appShutdown () override
 Stop node. More...
 
void startShutdown () override
 Start shutdown. More...
 
bool shutdownRequested () override
 Return whether shutdown was requested. More...
 
void mapPort (bool use_upnp) override
 Map port. More...
 
void setupServerArgs () override
 Setup arguments. More...
 
bool getProxy (Network net, proxyType &proxy_info) override
 Get proxy. More...
 
size_t getNodeCount (CConnman::NumConnections flags) override
 Get number of connections. More...
 
bool getNodesStats (NodesStats &stats) override
 
bool getBanned (banmap_t &banmap) override
 Get ban map entries. More...
 
bool ban (const CNetAddr &net_addr, BanReason reason, int64_t ban_time_offset) override
 Ban node. More...
 
bool unban (const CSubNet &ip) override
 Unban node. More...
 
bool disconnect (const CNetAddr &net_addr) override
 Disconnect node by address. More...
 
bool disconnect (NodeId id) override
 Disconnect node by id. More...
 
int64_t getTotalBytesRecv () override
 Get total bytes recv. More...
 
int64_t getTotalBytesSent () override
 Get total bytes sent. More...
 
size_t getMempoolSize () override
 Get mempool size. More...
 
size_t getMempoolDynamicUsage () override
 Get mempool dynamic usage. More...
 
bool getHeaderTip (int &height, int64_t &block_time) override
 Get header tip height and time. More...
 
int getNumBlocks () override
 Get num blocks. More...
 
int64_t getLastBlockTime () override
 Get last block time. More...
 
double getVerificationProgress () override
 Get verification progress. More...
 
bool isInitialBlockDownload () override
 Is initial block download. More...
 
bool getReindex () override
 Get reindex. More...
 
bool getImporting () override
 Get importing. More...
 
void setNetworkActive (bool active) override
 Set network active. More...
 
bool getNetworkActive () override
 Get network active. More...
 
CFeeRate estimateSmartFee (int num_blocks, bool conservative, int *returned_target=nullptr) override
 Estimate smart fee. More...
 
CFeeRate getDustRelayFee () override
 Get dust relay fee. More...
 
UniValue executeRpc (const std::string &command, const UniValue &params, const std::string &uri) override
 Execute rpc command. More...
 
std::vector< std::string > listRpcCommands () override
 List rpc commands. More...
 
void rpcSetTimerInterfaceIfUnset (RPCTimerInterface *iface) override
 Set RPC timer interface if unset. More...
 
void rpcUnsetTimerInterface (RPCTimerInterface *iface) override
 Unset RPC timer interface. More...
 
bool getUnspentOutput (const COutPoint &output, Coin &coin) override
 Get unspent outputs associated with a transaction. More...
 
std::string getWalletDir () override
 Return default wallet directory. More...
 
std::vector< std::string > listWalletDir () override
 Return available wallets in wallet directory. More...
 
std::vector< std::unique_ptr< Wallet > > getWallets () override
 Return interfaces for accessing wallets (if any). More...
 
std::unique_ptr< WalletloadWallet (const std::string &name, std::string &error, std::string &warning) override
 
std::unique_ptr< HandlerhandleInitMessage (InitMessageFn fn) override
 
std::unique_ptr< HandlerhandleMessageBox (MessageBoxFn fn) override
 
std::unique_ptr< HandlerhandleQuestion (QuestionFn fn) override
 
std::unique_ptr< HandlerhandleShowProgress (ShowProgressFn fn) override
 
std::unique_ptr< HandlerhandleLoadWallet (LoadWalletFn fn) override
 
std::unique_ptr< HandlerhandleNotifyNumConnectionsChanged (NotifyNumConnectionsChangedFn fn) override
 
std::unique_ptr< HandlerhandleNotifyNetworkActiveChanged (NotifyNetworkActiveChangedFn fn) override
 
std::unique_ptr< HandlerhandleNotifyAlertChanged (NotifyAlertChangedFn fn) override
 
std::unique_ptr< HandlerhandleBannedListChanged (BannedListChangedFn fn) override
 
std::unique_ptr< HandlerhandleNotifyBlockTip (NotifyBlockTipFn fn) override
 
std::unique_ptr< HandlerhandleNotifyHeaderTip (NotifyHeaderTipFn fn) override
 
- Public Member Functions inherited from interfaces::Node
virtual ~Node ()
 

Public Attributes

InitInterfaces m_interfaces
 

Additional Inherited Members

- Public Types inherited from interfaces::Node
using NodesStats = std::vector< std::tuple< CNodeStats, bool, CNodeStateStats > >
 Get stats for connected nodes. More...
 
using InitMessageFn = std::function< void(const std::string &message)>
 Register handler for init messages. More...
 
using MessageBoxFn = std::function< bool(const std::string &message, const std::string &caption, unsigned int style)>
 Register handler for message box messages. More...
 
using QuestionFn = std::function< bool(const std::string &message, const std::string &non_interactive_message, const std::string &caption, unsigned int style)>
 Register handler for question messages. More...
 
using ShowProgressFn = std::function< void(const std::string &title, int progress, bool resume_possible)>
 Register handler for progress messages. More...
 
using LoadWalletFn = std::function< void(std::unique_ptr< Wallet > wallet)>
 Register handler for load wallet messages. More...
 
using NotifyNumConnectionsChangedFn = std::function< void(int new_num_connections)>
 Register handler for number of connections changed messages. More...
 
using NotifyNetworkActiveChangedFn = std::function< void(bool network_active)>
 Register handler for network active messages. More...
 
using NotifyAlertChangedFn = std::function< void()>
 Register handler for notify alert messages. More...
 
using BannedListChangedFn = std::function< void()>
 Register handler for ban list messages. More...
 
using NotifyBlockTipFn = std::function< void(bool initial_download, int height, int64_t block_time, double verification_progress)>
 Register handler for block tip messages. More...
 
using NotifyHeaderTipFn = std::function< void(bool initial_download, int height, int64_t block_time, double verification_progress)>
 Register handler for header tip messages. More...
 

Constructor & Destructor Documentation

◆ NodeImpl()

interfaces::anonymous_namespace{node.cpp}::NodeImpl::NodeImpl ( )
inline

Member Function Documentation

◆ appInitMain()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::appInitMain ( )
inlineoverridevirtual

Start node.

Implements interfaces::Node.

◆ appShutdown()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::appShutdown ( )
inlineoverridevirtual

Stop node.

Implements interfaces::Node.

◆ ban()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::ban ( const CNetAddr net_addr,
BanReason  reason,
int64_t  ban_time_offset 
)
inlineoverridevirtual

Ban node.

Implements interfaces::Node.

◆ baseInitialize()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::baseInitialize ( )
inlineoverridevirtual

Initialize app dependencies.

Implements interfaces::Node.

◆ disconnect() [1/2]

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::disconnect ( const CNetAddr net_addr)
inlineoverridevirtual

Disconnect node by address.

Implements interfaces::Node.

◆ disconnect() [2/2]

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::disconnect ( NodeId  id)
inlineoverridevirtual

Disconnect node by id.

Implements interfaces::Node.

◆ estimateSmartFee()

CFeeRate interfaces::anonymous_namespace{node.cpp}::NodeImpl::estimateSmartFee ( int  num_blocks,
bool  conservative,
int *  returned_target = nullptr 
)
inlineoverridevirtual

Estimate smart fee.

Implements interfaces::Node.

◆ executeRpc()

UniValue interfaces::anonymous_namespace{node.cpp}::NodeImpl::executeRpc ( const std::string &  command,
const UniValue params,
const std::string &  uri 
)
inlineoverridevirtual

Execute rpc command.

Implements interfaces::Node.

◆ getAssumedBlockchainSize()

uint64_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getAssumedBlockchainSize ( )
inlineoverridevirtual

Get the (assumed) blockchain size.

Implements interfaces::Node.

◆ getAssumedChainStateSize()

uint64_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getAssumedChainStateSize ( )
inlineoverridevirtual

Get the (assumed) chain state size.

Implements interfaces::Node.

◆ getBanned()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getBanned ( banmap_t banmap)
inlineoverridevirtual

Get ban map entries.

Implements interfaces::Node.

◆ getDustRelayFee()

CFeeRate interfaces::anonymous_namespace{node.cpp}::NodeImpl::getDustRelayFee ( )
inlineoverridevirtual

Get dust relay fee.

Implements interfaces::Node.

◆ getHeaderTip()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getHeaderTip ( int &  height,
int64_t block_time 
)
inlineoverridevirtual

Get header tip height and time.

Implements interfaces::Node.

◆ getImporting()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getImporting ( )
inlineoverridevirtual

Get importing.

Implements interfaces::Node.

◆ getLastBlockTime()

int64_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getLastBlockTime ( )
inlineoverridevirtual

Get last block time.

Implements interfaces::Node.

◆ getLogCategories()

uint32_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getLogCategories ( )
inlineoverridevirtual

Implements interfaces::Node.

◆ getMempoolDynamicUsage()

size_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getMempoolDynamicUsage ( )
inlineoverridevirtual

Get mempool dynamic usage.

Implements interfaces::Node.

◆ getMempoolSize()

size_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getMempoolSize ( )
inlineoverridevirtual

Get mempool size.

Implements interfaces::Node.

◆ getNetwork()

std::string interfaces::anonymous_namespace{node.cpp}::NodeImpl::getNetwork ( )
inlineoverridevirtual

Get network name.

Implements interfaces::Node.

◆ getNetworkActive()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getNetworkActive ( )
inlineoverridevirtual

Get network active.

Implements interfaces::Node.

◆ getNodeCount()

size_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getNodeCount ( CConnman::NumConnections  flags)
inlineoverridevirtual

Get number of connections.

Implements interfaces::Node.

◆ getNodesStats()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getNodesStats ( NodesStats stats)
inlineoverridevirtual

Implements interfaces::Node.

◆ getNumBlocks()

int interfaces::anonymous_namespace{node.cpp}::NodeImpl::getNumBlocks ( )
inlineoverridevirtual

Get num blocks.

Implements interfaces::Node.

◆ getProxy()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getProxy ( Network  net,
proxyType proxy_info 
)
inlineoverridevirtual

Get proxy.

Implements interfaces::Node.

◆ getReindex()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getReindex ( )
inlineoverridevirtual

Get reindex.

Implements interfaces::Node.

◆ getTotalBytesRecv()

int64_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getTotalBytesRecv ( )
inlineoverridevirtual

Get total bytes recv.

Implements interfaces::Node.

◆ getTotalBytesSent()

int64_t interfaces::anonymous_namespace{node.cpp}::NodeImpl::getTotalBytesSent ( )
inlineoverridevirtual

Get total bytes sent.

Implements interfaces::Node.

◆ getUnspentOutput()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::getUnspentOutput ( const COutPoint output,
Coin coin 
)
inlineoverridevirtual

Get unspent outputs associated with a transaction.

Implements interfaces::Node.

◆ getVerificationProgress()

double interfaces::anonymous_namespace{node.cpp}::NodeImpl::getVerificationProgress ( )
inlineoverridevirtual

Get verification progress.

Implements interfaces::Node.

◆ getWalletDir()

std::string interfaces::anonymous_namespace{node.cpp}::NodeImpl::getWalletDir ( )
inlineoverridevirtual

Return default wallet directory.

Implements interfaces::Node.

◆ getWallets()

std::vector<std::unique_ptr<Wallet> > interfaces::anonymous_namespace{node.cpp}::NodeImpl::getWallets ( )
inlineoverridevirtual

Return interfaces for accessing wallets (if any).

Implements interfaces::Node.

◆ getWarnings()

std::string interfaces::anonymous_namespace{node.cpp}::NodeImpl::getWarnings ( const std::string &  type)
inlineoverridevirtual

Get warnings.

Implements interfaces::Node.

◆ handleBannedListChanged()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleBannedListChanged ( BannedListChangedFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleInitMessage()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleInitMessage ( InitMessageFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleLoadWallet()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleLoadWallet ( LoadWalletFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleMessageBox()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleMessageBox ( MessageBoxFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleNotifyAlertChanged()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleNotifyAlertChanged ( NotifyAlertChangedFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleNotifyBlockTip()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleNotifyBlockTip ( NotifyBlockTipFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleNotifyHeaderTip()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleNotifyHeaderTip ( NotifyHeaderTipFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleNotifyNetworkActiveChanged()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleNotifyNetworkActiveChanged ( NotifyNetworkActiveChangedFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleNotifyNumConnectionsChanged()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleNotifyNumConnectionsChanged ( NotifyNumConnectionsChangedFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleQuestion()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleQuestion ( QuestionFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ handleShowProgress()

std::unique_ptr<Handler> interfaces::anonymous_namespace{node.cpp}::NodeImpl::handleShowProgress ( ShowProgressFn  fn)
inlineoverridevirtual

Implements interfaces::Node.

◆ initLogging()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::initLogging ( )
inlineoverridevirtual

Init logging.

Implements interfaces::Node.

◆ initParameterInteraction()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::initParameterInteraction ( )
inlineoverridevirtual

Init parameter interaction.

Implements interfaces::Node.

◆ isInitialBlockDownload()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::isInitialBlockDownload ( )
inlineoverridevirtual

Is initial block download.

Implements interfaces::Node.

◆ listRpcCommands()

std::vector<std::string> interfaces::anonymous_namespace{node.cpp}::NodeImpl::listRpcCommands ( )
inlineoverridevirtual

List rpc commands.

Implements interfaces::Node.

◆ listWalletDir()

std::vector<std::string> interfaces::anonymous_namespace{node.cpp}::NodeImpl::listWalletDir ( )
inlineoverridevirtual

Return available wallets in wallet directory.

Implements interfaces::Node.

◆ loadWallet()

std::unique_ptr<Wallet> interfaces::anonymous_namespace{node.cpp}::NodeImpl::loadWallet ( const std::string &  name,
std::string &  error,
std::string &  warning 
)
inlineoverridevirtual

Attempts to load a wallet from file or directory. The loaded wallet is also notified to handlers previously registered with handleLoadWallet.

Implements interfaces::Node.

◆ mapPort()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::mapPort ( bool  use_upnp)
inlineoverridevirtual

Map port.

Implements interfaces::Node.

◆ parseParameters()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::parseParameters ( int  argc,
const char *const  argv[],
std::string &  error 
)
inlineoverridevirtual

Set command line arguments.

Implements interfaces::Node.

◆ readConfigFiles()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::readConfigFiles ( std::string &  error)
inlineoverridevirtual

Load settings from configuration file.

Implements interfaces::Node.

◆ rpcSetTimerInterfaceIfUnset()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::rpcSetTimerInterfaceIfUnset ( RPCTimerInterface iface)
inlineoverridevirtual

Set RPC timer interface if unset.

Implements interfaces::Node.

◆ rpcUnsetTimerInterface()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::rpcUnsetTimerInterface ( RPCTimerInterface iface)
inlineoverridevirtual

Unset RPC timer interface.

Implements interfaces::Node.

◆ selectParams()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::selectParams ( const std::string &  network)
inlineoverridevirtual

Choose network parameters.

Implements interfaces::Node.

◆ setNetworkActive()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::setNetworkActive ( bool  active)
inlineoverridevirtual

Set network active.

Implements interfaces::Node.

◆ setupServerArgs()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::setupServerArgs ( )
inlineoverridevirtual

Setup arguments.

Implements interfaces::Node.

◆ shutdownRequested()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::shutdownRequested ( )
inlineoverridevirtual

Return whether shutdown was requested.

Implements interfaces::Node.

◆ softSetArg()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::softSetArg ( const std::string &  arg,
const std::string &  value 
)
inlineoverridevirtual

Set a command line argument if it doesn't already have a value.

Implements interfaces::Node.

◆ softSetBoolArg()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::softSetBoolArg ( const std::string &  arg,
bool  value 
)
inlineoverridevirtual

Set a command line boolean argument if it doesn't already have a value.

Implements interfaces::Node.

◆ startShutdown()

void interfaces::anonymous_namespace{node.cpp}::NodeImpl::startShutdown ( )
inlineoverridevirtual

Start shutdown.

Implements interfaces::Node.

◆ unban()

bool interfaces::anonymous_namespace{node.cpp}::NodeImpl::unban ( const CSubNet ip)
inlineoverridevirtual

Unban node.

Implements interfaces::Node.

Member Data Documentation

◆ m_interfaces

InitInterfaces interfaces::anonymous_namespace{node.cpp}::NodeImpl::m_interfaces

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