Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show All 18 Lines | |||||
#include <rpc/blockchain.h> | #include <rpc/blockchain.h> | ||||
#include <rpc/protocol.h> | #include <rpc/protocol.h> | ||||
#include <rpc/util.h> | #include <rpc/util.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <timedata.h> | #include <timedata.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/string.h> | #include <util/string.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.h> | |||||
#include <validation.h> | #include <validation.h> | ||||
#include <version.h> | #include <version.h> | ||||
#include <warnings.h> | #include <warnings.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
static UniValue getconnectioncount(const Config &config, | static UniValue getconnectioncount(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
▲ Show 20 Lines • Show All 666 Lines • ▼ Show 20 Lines | UniValue localAddresses(UniValue::VARR); | ||||
UniValue rec(UniValue::VOBJ); | UniValue rec(UniValue::VOBJ); | ||||
rec.pushKV("address", item.first.ToString()); | rec.pushKV("address", item.first.ToString()); | ||||
rec.pushKV("port", item.second.nPort); | rec.pushKV("port", item.second.nPort); | ||||
rec.pushKV("score", item.second.nScore); | rec.pushKV("score", item.second.nScore); | ||||
localAddresses.push_back(rec); | localAddresses.push_back(rec); | ||||
} | } | ||||
} | } | ||||
obj.pushKV("localaddresses", localAddresses); | obj.pushKV("localaddresses", localAddresses); | ||||
obj.pushKV("warnings", GetWarnings(false)); | obj.pushKV("warnings", GetWarnings(false).original); | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue setban(const Config &config, const JSONRPCRequest &request) { | static UniValue setban(const Config &config, const JSONRPCRequest &request) { | ||||
const RPCHelpMan help{ | const RPCHelpMan help{ | ||||
"setban", | "setban", | ||||
"Attempts to add or remove an IP/Subnet from the banned list.\n", | "Attempts to add or remove an IP/Subnet from the banned list.\n", | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |