Bitcoin Core  0.20.99
P2P Digital Currency
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
NetinfoRequestHandler Class Reference

Process netinfo requests. More...

Inheritance diagram for NetinfoRequestHandler:
Collaboration diagram for NetinfoRequestHandler:


struct  Peer

Public Member Functions

UniValue PrepareRequest (const std::string &method, const std::vector< std::string > &args) override
UniValue ProcessReply (const UniValue &batch_in) override
- Public Member Functions inherited from BaseRequestHandler
virtual ~BaseRequestHandler ()

Static Public Attributes

static constexpr int ID_PEERINFO = 0
static constexpr int ID_NETWORKINFO = 1

Private Member Functions

int8_t NetworkStringToId (const std::string &str) const
bool DetailsRequested () const
bool IsAddressSelected () const
bool IsVersionSelected () const
std::string ChainToString () const

Private Attributes

const std::array< std::string, m_networks_sizem_networks {{"ipv4", "ipv6", "onion"}}
std::array< std::array< uint16_t, m_networks_size+2 >, 3 > m_counts {{{}}}
 Peer counts by (in/out/total, networks/total/block-relay) More...
uint8_t m_details_level {0}
 Optional user-supplied arg to set dashboard details level. More...
bool m_is_asmap_on {false}
size_t m_max_addr_length {0}
size_t m_max_id_length {2}
std::vector< Peerm_peers
const int64_t m_time_now {GetSystemTimeInSeconds()}

Static Private Attributes

static constexpr int8_t UNKNOWN_NETWORK {-1}
static constexpr size_t m_networks_size {3}

Detailed Description

Process netinfo requests.

Definition at line 296 of file bitcoin-cli.cpp.

Member Function Documentation

◆ ChainToString()

std::string NetinfoRequestHandler::ChainToString ( ) const

Definition at line 336 of file bitcoin-cli.cpp.

Here is the call graph for this function:

◆ DetailsRequested()

bool NetinfoRequestHandler::DetailsRequested ( ) const

Definition at line 311 of file bitcoin-cli.cpp.

◆ IsAddressSelected()

bool NetinfoRequestHandler::IsAddressSelected ( ) const

Definition at line 312 of file bitcoin-cli.cpp.

◆ IsVersionSelected()

bool NetinfoRequestHandler::IsVersionSelected ( ) const

Definition at line 313 of file bitcoin-cli.cpp.

◆ NetworkStringToId()

int8_t NetinfoRequestHandler::NetworkStringToId ( const std::string &  str) const

Definition at line 303 of file bitcoin-cli.cpp.

◆ PrepareRequest()

UniValue NetinfoRequestHandler::PrepareRequest ( const std::string &  method,
const std::vector< std::string > &  args 

Implements BaseRequestHandler.

Definition at line 348 of file bitcoin-cli.cpp.

Here is the call graph for this function:

◆ ProcessReply()

UniValue NetinfoRequestHandler::ProcessReply ( const UniValue batch_in)

Implements BaseRequestHandler.

Definition at line 362 of file bitcoin-cli.cpp.

Here is the call graph for this function:

Member Data Documentation


constexpr int NetinfoRequestHandler::ID_NETWORKINFO = 1

Definition at line 346 of file bitcoin-cli.cpp.


constexpr int NetinfoRequestHandler::ID_PEERINFO = 0

Definition at line 345 of file bitcoin-cli.cpp.

◆ m_counts

std::array<std::array<uint16_t, m_networks_size + 2>, 3> NetinfoRequestHandler::m_counts {{{}}}

Peer counts by (in/out/total, networks/total/block-relay)

Definition at line 302 of file bitcoin-cli.cpp.

◆ m_details_level

uint8_t NetinfoRequestHandler::m_details_level {0}

Optional user-supplied arg to set dashboard details level.

Definition at line 310 of file bitcoin-cli.cpp.

◆ m_is_asmap_on

bool NetinfoRequestHandler::m_is_asmap_on {false}

Definition at line 314 of file bitcoin-cli.cpp.

◆ m_max_addr_length

size_t NetinfoRequestHandler::m_max_addr_length {0}

Definition at line 315 of file bitcoin-cli.cpp.

◆ m_max_id_length

size_t NetinfoRequestHandler::m_max_id_length {2}

Definition at line 316 of file bitcoin-cli.cpp.

◆ m_networks

const std::array<std::string, m_networks_size> NetinfoRequestHandler::m_networks {{"ipv4", "ipv6", "onion"}}

Definition at line 301 of file bitcoin-cli.cpp.

◆ m_networks_size

constexpr size_t NetinfoRequestHandler::m_networks_size {3}

Definition at line 300 of file bitcoin-cli.cpp.

◆ m_peers

std::vector<Peer> NetinfoRequestHandler::m_peers

Definition at line 335 of file bitcoin-cli.cpp.

◆ m_time_now

const int64_t NetinfoRequestHandler::m_time_now {GetSystemTimeInSeconds()}

Definition at line 342 of file bitcoin-cli.cpp.


constexpr int8_t NetinfoRequestHandler::UNKNOWN_NETWORK {-1}

Definition at line 299 of file bitcoin-cli.cpp.

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