mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 09:55:49 +02:00
refactor: move GetServicesNames from rpc/util.{h,cpp} to rpc/net.cpp
as it is only called from that compilation unit. This avoids needlessly compiling GetServicesNames() in the 35 other files that include rpc/util.h.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <netbase.h>
|
||||
#include <node/context.h>
|
||||
#include <policy/settings.h>
|
||||
#include <protocol.h>
|
||||
#include <rpc/blockchain.h>
|
||||
#include <rpc/protocol.h>
|
||||
#include <rpc/server_util.h>
|
||||
@@ -91,6 +92,18 @@ static RPCHelpMan ping()
|
||||
};
|
||||
}
|
||||
|
||||
/** Returns, given services flags, a list of humanly readable (known) network services */
|
||||
static UniValue GetServicesNames(ServiceFlags services)
|
||||
{
|
||||
UniValue servicesNames(UniValue::VARR);
|
||||
|
||||
for (const auto& flag : serviceFlagsToStr(services)) {
|
||||
servicesNames.push_back(flag);
|
||||
}
|
||||
|
||||
return servicesNames;
|
||||
}
|
||||
|
||||
static RPCHelpMan getpeerinfo()
|
||||
{
|
||||
return RPCHelpMan{
|
||||
|
||||
Reference in New Issue
Block a user