diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 14a0cb245fa..1f4b512f420 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -463,6 +463,17 @@ private: } return str; } + static std::string ServicesList(const UniValue& services) + { + std::string str{services.size() ? services[0].get_str() : ""}; + for (size_t i{1}; i < services.size(); ++i) { + str += ", " + services[i].get_str(); + } + for (auto& c: str) { + c = (c == '_' ? ' ' : ToLower(c)); + } + return str; + } public: static constexpr int ID_PEERINFO = 0; @@ -636,7 +647,8 @@ public: } } - // Report local addresses, ports, and scores. + // Report local services, addresses, ports, and scores. + result += strprintf("\n\nLocal services: %s", ServicesList(networkinfo["localservicesnames"])); result += "\n\nLocal addresses"; const std::vector& local_addrs{networkinfo["localaddresses"].getValues()}; if (local_addrs.empty()) {