Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.h
Show All 18 Lines | |||||
#include <vector> | #include <vector> | ||||
struct CNodeStateStats; | struct CNodeStateStats; | ||||
struct CNodeStats; | struct CNodeStats; | ||||
class Config; | class Config; | ||||
class HTTPRPCRequestProcessor; | class HTTPRPCRequestProcessor; | ||||
class proxyType; | class proxyType; | ||||
class RPCServer; | class RPCServer; | ||||
class RPCTimerInterface; | |||||
class UniValue; | |||||
namespace interfaces { | namespace interfaces { | ||||
class Handler; | class Handler; | ||||
class Wallet; | class Wallet; | ||||
//! Top-level interface for a bitcoin node (bitcoind process). | //! Top-level interface for a bitcoin node (bitcoind process). | ||||
class Node { | class Node { | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | public: | ||||
//! Get stats for connected nodes. | //! Get stats for connected nodes. | ||||
using NodesStats = | using NodesStats = | ||||
std::vector<std::tuple<CNodeStats, bool, CNodeStateStats>>; | std::vector<std::tuple<CNodeStats, bool, CNodeStateStats>>; | ||||
virtual bool getNodesStats(NodesStats &stats) = 0; | virtual bool getNodesStats(NodesStats &stats) = 0; | ||||
//! Get ban map entries. | //! Get ban map entries. | ||||
virtual bool getBanned(banmap_t &banmap) = 0; | virtual bool getBanned(banmap_t &banmap) = 0; | ||||
//! Ban node. | |||||
virtual bool ban(const CNetAddr &net_addr, BanReason reason, | |||||
int64_t ban_time_offset) = 0; | |||||
//! Unban node. | |||||
virtual bool unban(const CSubNet &ip) = 0; | |||||
//! Disconnect node. | |||||
virtual bool disconnect(NodeId id) = 0; | |||||
//! Get total bytes recv. | //! Get total bytes recv. | ||||
virtual int64_t getTotalBytesRecv() = 0; | virtual int64_t getTotalBytesRecv() = 0; | ||||
//! Get total bytes sent. | //! Get total bytes sent. | ||||
virtual int64_t getTotalBytesSent() = 0; | virtual int64_t getTotalBytesSent() = 0; | ||||
//! Get mempool size. | //! Get mempool size. | ||||
virtual size_t getMempoolSize() = 0; | virtual size_t getMempoolSize() = 0; | ||||
Show All 23 Lines | public: | ||||
virtual bool getImporting() = 0; | virtual bool getImporting() = 0; | ||||
//! Set network active. | //! Set network active. | ||||
virtual void setNetworkActive(bool active) = 0; | virtual void setNetworkActive(bool active) = 0; | ||||
//! Get network active. | //! Get network active. | ||||
virtual bool getNetworkActive() = 0; | virtual bool getNetworkActive() = 0; | ||||
//! Execute rpc command. | |||||
virtual UniValue executeRpc(Config &config, const std::string &command, | |||||
const UniValue ¶ms, | |||||
const std::string &uri) = 0; | |||||
//! List rpc commands. | |||||
virtual std::vector<std::string> listRpcCommands() = 0; | |||||
//! Set RPC timer interface if unset. | |||||
virtual void rpcSetTimerInterfaceIfUnset(RPCTimerInterface *iface) = 0; | |||||
//! Unset RPC timer interface. | |||||
virtual void rpcUnsetTimerInterface(RPCTimerInterface *iface) = 0; | |||||
//! Register handler for init messages. | //! Register handler for init messages. | ||||
using InitMessageFn = std::function<void(const std::string &message)>; | using InitMessageFn = std::function<void(const std::string &message)>; | ||||
virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; | virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; | ||||
//! Register handler for message box messages. | //! Register handler for message box messages. | ||||
using MessageBoxFn = | using MessageBoxFn = | ||||
std::function<bool(const std::string &message, | std::function<bool(const std::string &message, | ||||
const std::string &caption, unsigned int style)>; | const std::string &caption, unsigned int style)>; | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |