Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.h
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_INTERFACES_NODE_H | #ifndef BITCOIN_INTERFACES_NODE_H | ||||
#define BITCOIN_INTERFACES_NODE_H | #define BITCOIN_INTERFACES_NODE_H | ||||
#include <init.h> // For HelpMessageMode | #include <init.h> // For HelpMessageMode | ||||
#include <net.h> // For CConnman::NumConnections | #include <net.h> // For CConnman::NumConnections | ||||
#include <netaddress.h> // For Network | #include <netaddress.h> // For Network | ||||
#include <cstddef> | #include <cstddef> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <functional> | #include <functional> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
#include <tuple> | |||||
#include <vector> | |||||
struct CNodeStateStats; | |||||
struct CNodeStats; | |||||
class Config; | class Config; | ||||
class HTTPRPCRequestProcessor; | class HTTPRPCRequestProcessor; | ||||
class proxyType; | class proxyType; | ||||
class RPCServer; | class RPCServer; | ||||
namespace interfaces { | namespace interfaces { | ||||
class Handler; | class Handler; | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | public: | ||||
virtual void mapPort(bool use_upnp) = 0; | virtual void mapPort(bool use_upnp) = 0; | ||||
//! Get proxy. | //! Get proxy. | ||||
virtual bool getProxy(Network net, proxyType &proxy_info) = 0; | virtual bool getProxy(Network net, proxyType &proxy_info) = 0; | ||||
//! Get number of connections. | //! Get number of connections. | ||||
virtual size_t getNodeCount(CConnman::NumConnections flags) = 0; | virtual size_t getNodeCount(CConnman::NumConnections flags) = 0; | ||||
//! Get stats for connected nodes. | |||||
using NodesStats = | |||||
std::vector<std::tuple<CNodeStats, bool, CNodeStateStats>>; | |||||
virtual bool getNodesStats(NodesStats &stats) = 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 20 Lines • Show All 99 Lines • Show Last 20 Lines |