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 <addrdb.h> // For banmap_t | |||||
#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> | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | public: | ||||
//! 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. | //! 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. | |||||
virtual bool getBanned(banmap_t &banmap) = 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 |