mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-12 07:39:41 +02:00
[rpc] Remove deprecated "whitelisted" field from getpeerinfo
This commit is contained in:
@@ -599,7 +599,6 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
|
||||
X(mapRecvBytesPerMsgCmd);
|
||||
X(nRecvBytes);
|
||||
}
|
||||
X(m_legacyWhitelisted);
|
||||
X(m_permissionFlags);
|
||||
if (m_tx_relay != nullptr) {
|
||||
LOCK(m_tx_relay->cs_feeFilter);
|
||||
@@ -1122,8 +1121,6 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
|
||||
CNode* pnode = new CNode(id, nodeServices, GetBestHeight(), hSocket, addr, CalculateKeyedNetGroup(addr), nonce, addr_bind, "", ConnectionType::INBOUND, inbound_onion);
|
||||
pnode->AddRef();
|
||||
pnode->m_permissionFlags = permissionFlags;
|
||||
// If this flag is present, the user probably expect that RPC and QT report it as whitelisted (backward compatibility)
|
||||
pnode->m_legacyWhitelisted = legacyWhitelisted;
|
||||
pnode->m_prefer_evict = discouraged;
|
||||
m_msgproc->InitializeNode(pnode);
|
||||
|
||||
|
||||
@@ -710,7 +710,6 @@ public:
|
||||
uint64_t nRecvBytes;
|
||||
mapMsgCmdSize mapRecvBytesPerMsgCmd;
|
||||
NetPermissionFlags m_permissionFlags;
|
||||
bool m_legacyWhitelisted;
|
||||
int64_t m_ping_usec;
|
||||
int64_t m_ping_wait_usec;
|
||||
int64_t m_min_ping_usec;
|
||||
@@ -891,8 +890,6 @@ public:
|
||||
bool HasPermission(NetPermissionFlags permission) const {
|
||||
return NetPermissions::HasFlag(m_permissionFlags, permission);
|
||||
}
|
||||
// This boolean is unusued in actual processing, only present for backward compatibility at RPC/QT level
|
||||
bool m_legacyWhitelisted{false};
|
||||
bool fClient{false}; // set by version message
|
||||
bool m_limited_node{false}; //after BIP159, set by version message
|
||||
/**
|
||||
|
||||
@@ -138,8 +138,6 @@ static RPCHelpMan getpeerinfo()
|
||||
{
|
||||
{RPCResult::Type::NUM, "n", "The heights of blocks we're currently asking from this peer"},
|
||||
}},
|
||||
{RPCResult::Type::BOOL, "whitelisted", /* optional */ true, "Whether the peer is whitelisted with default permissions\n"
|
||||
"(DEPRECATED, returned only if config option -deprecatedrpc=whitelisted is passed)"},
|
||||
{RPCResult::Type::ARR, "permissions", "Any special permissions that have been granted to this peer",
|
||||
{
|
||||
{RPCResult::Type::STR, "permission_type", Join(NET_PERMISSIONS_DOC, ",\n") + ".\n"},
|
||||
@@ -231,10 +229,6 @@ static RPCHelpMan getpeerinfo()
|
||||
}
|
||||
obj.pushKV("inflight", heights);
|
||||
}
|
||||
if (IsDeprecatedRPCEnabled("whitelisted")) {
|
||||
// whitelisted is deprecated in v0.21 for removal in v0.22
|
||||
obj.pushKV("whitelisted", stats.m_legacyWhitelisted);
|
||||
}
|
||||
UniValue permissions(UniValue::VARR);
|
||||
for (const auto& permission : NetPermissions::ToStrings(stats.m_permissionFlags)) {
|
||||
permissions.push_back(permission);
|
||||
|
||||
Reference in New Issue
Block a user