Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
{{RPCResult::Type::STR, "SERVICE_NAME", | {{RPCResult::Type::STR, "SERVICE_NAME", | ||||
"the service name if it is recognised"}}}, | "the service name if it is recognised"}}}, | ||||
{RPCResult::Type::BOOL, "relaytxes", | {RPCResult::Type::BOOL, "relaytxes", | ||||
"Whether peer has asked us to relay transactions to it"}, | "Whether peer has asked us to relay transactions to it"}, | ||||
{RPCResult::Type::NUM_TIME, "lastsend", | {RPCResult::Type::NUM_TIME, "lastsend", | ||||
"The " + UNIX_EPOCH_TIME + " of the last send"}, | "The " + UNIX_EPOCH_TIME + " of the last send"}, | ||||
{RPCResult::Type::NUM_TIME, "lastrecv", | {RPCResult::Type::NUM_TIME, "lastrecv", | ||||
"The " + UNIX_EPOCH_TIME + " of the last receive"}, | "The " + UNIX_EPOCH_TIME + " of the last receive"}, | ||||
{RPCResult::Type::NUM_TIME, "last_transaction", | |||||
"The " + UNIX_EPOCH_TIME + | |||||
" of the last valid transaction received from this " | |||||
"peer"}, | |||||
{RPCResult::Type::NUM_TIME, "last_block", | |||||
"The " + UNIX_EPOCH_TIME + | |||||
" of the last block received from this peer"}, | |||||
{RPCResult::Type::NUM, "bytessent", "The total bytes sent"}, | {RPCResult::Type::NUM, "bytessent", "The total bytes sent"}, | ||||
{RPCResult::Type::NUM, "bytesrecv", | {RPCResult::Type::NUM, "bytesrecv", | ||||
"The total bytes received"}, | "The total bytes received"}, | ||||
{RPCResult::Type::NUM_TIME, "conntime", | {RPCResult::Type::NUM_TIME, "conntime", | ||||
"The " + UNIX_EPOCH_TIME + " of the connection"}, | "The " + UNIX_EPOCH_TIME + " of the connection"}, | ||||
{RPCResult::Type::NUM, "timeoffset", | {RPCResult::Type::NUM, "timeoffset", | ||||
"The time offset in seconds"}, | "The time offset in seconds"}, | ||||
{RPCResult::Type::NUM, "pingtime", | {RPCResult::Type::NUM, "pingtime", | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | for (const CNodeStats &stats : vstats) { | ||||
if (stats.m_mapped_as != 0) { | if (stats.m_mapped_as != 0) { | ||||
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_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); | ||||
} | } | ||||
if (stats.m_min_ping_usec < std::numeric_limits<int64_t>::max()) { | if (stats.m_min_ping_usec < std::numeric_limits<int64_t>::max()) { | ||||
▲ Show 20 Lines • Show All 766 Lines • Show Last 20 Lines |