Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
// Copyright (c) 2009-2019 The Bitcoin Core developers | // Copyright (c) 2009-2019 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. | ||||
#include <rpc/server.h> | #include <rpc/server.h> | ||||
#include <avalanche/avalanche.h> | |||||
#include <banman.h> | #include <banman.h> | ||||
#include <clientversion.h> | #include <clientversion.h> | ||||
#include <config.h> | #include <config.h> | ||||
#include <core_io.h> | #include <core_io.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <net_permissions.h> | #include <net_permissions.h> | ||||
#include <net_processing.h> | #include <net_processing.h> | ||||
#include <net_types.h> // For banmap_t | #include <net_types.h> // For banmap_t | ||||
▲ Show 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | for (const CNodeStats &stats : vstats) { | ||||
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as)); | obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as)); | ||||
} | } | ||||
obj.pushKV("services", strprintf("%016x", stats.nServices)); | obj.pushKV("services", strprintf("%016x", stats.nServices)); | ||||
obj.pushKV("servicesnames", GetServicesNames(stats.nServices)); | obj.pushKV("servicesnames", GetServicesNames(stats.nServices)); | ||||
obj.pushKV("relaytxes", stats.fRelayTxes); | obj.pushKV("relaytxes", stats.fRelayTxes); | ||||
obj.pushKV("lastsend", stats.nLastSend); | obj.pushKV("lastsend", stats.nLastSend); | ||||
obj.pushKV("lastrecv", stats.nLastRecv); | obj.pushKV("lastrecv", stats.nLastRecv); | ||||
obj.pushKV("last_transaction", stats.nLastTXTime); | obj.pushKV("last_transaction", stats.nLastTXTime); | ||||
if (g_avalanche) { | |||||
obj.pushKV("last_proof", stats.nLastProofTime); | |||||
} | |||||
obj.pushKV("last_block", stats.nLastBlockTime); | obj.pushKV("last_block", stats.nLastBlockTime); | ||||
obj.pushKV("bytessent", stats.nSendBytes); | obj.pushKV("bytessent", stats.nSendBytes); | ||||
obj.pushKV("bytesrecv", stats.nRecvBytes); | obj.pushKV("bytesrecv", stats.nRecvBytes); | ||||
obj.pushKV("conntime", stats.nTimeConnected); | obj.pushKV("conntime", stats.nTimeConnected); | ||||
obj.pushKV("timeoffset", stats.nTimeOffset); | obj.pushKV("timeoffset", stats.nTimeOffset); | ||||
if (stats.m_ping_usec > 0) { | if (stats.m_ping_usec > 0) { | ||||
obj.pushKV("pingtime", double(stats.m_ping_usec) / 1e6); | obj.pushKV("pingtime", double(stats.m_ping_usec) / 1e6); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 766 Lines • Show Last 20 Lines |