Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/util.cpp
Show First 20 Lines • Show All 860 Lines • ▼ Show 20 Lines | for (int i = range.first; i <= range.second; ++i) { | ||||
desc_str)); | desc_str)); | ||||
} | } | ||||
std::move(scripts.begin(), scripts.end(), std::back_inserter(ret)); | std::move(scripts.begin(), scripts.end(), std::back_inserter(ret)); | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
UniValue GetServicesNames(ServiceFlags services) { | UniValue GetServicesNames(ServiceFlags services) { | ||||
const uint64_t services_n = services; | |||||
UniValue servicesNames(UniValue::VARR); | UniValue servicesNames(UniValue::VARR); | ||||
if (services & NODE_NETWORK) { | for (int i = 0; i < 64; ++i) { | ||||
servicesNames.push_back("NETWORK"); | const uint64_t mask = 1ull << i; | ||||
if (services_n & mask) { | |||||
servicesNames.push_back(serviceFlagToStr(mask, i)); | |||||
} | } | ||||
if (services & NODE_GETUTXO) { | |||||
servicesNames.push_back("GETUTXO"); | |||||
} | |||||
if (services & NODE_BLOOM) { | |||||
servicesNames.push_back("BLOOM"); | |||||
} | |||||
if (services & NODE_XTHIN) { | |||||
servicesNames.push_back("XTHIN"); | |||||
} | |||||
if (services & NODE_NETWORK_LIMITED) { | |||||
servicesNames.push_back("NETWORK_LIMITED"); | |||||
} | |||||
if (services & NODE_AVALANCHE) { | |||||
servicesNames.push_back("AVALANCHE"); | |||||
} | } | ||||
return servicesNames; | return servicesNames; | ||||
} | } |