diff options
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r-- | src/rpc/util.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 860fa198d5..0e13d8dfce 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -841,18 +841,15 @@ std::vector<CScript> EvalDescriptorStringOrObject(const UniValue& scanobject, Fl UniValue GetServicesNames(ServiceFlags services) { + const uint64_t services_n = services; UniValue servicesNames(UniValue::VARR); - if (services & NODE_NETWORK) - servicesNames.push_back("NETWORK"); - if (services & NODE_GETUTXO) - servicesNames.push_back("GETUTXO"); - if (services & NODE_BLOOM) - servicesNames.push_back("BLOOM"); - if (services & NODE_WITNESS) - servicesNames.push_back("WITNESS"); - if (services & NODE_NETWORK_LIMITED) - servicesNames.push_back("NETWORK_LIMITED"); + for (int i = 0; i < 64; ++i) { + const uint64_t mask = 1ull << i; + if (services_n & mask) { + servicesNames.push_back(serviceFlagToStr(mask, i)); + } + } return servicesNames; } |