diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 4e3a748aff8..e51d4a3c65f 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -582,7 +582,8 @@ public: } // Generate report header. - std::string result{strprintf("%s client %s%s - server %i%s\n\n", CLIENT_NAME, FormatFullVersion(), ChainToString(), networkinfo["protocolversion"].getInt(), networkinfo["subversion"].get_str())}; + const std::string_view services{DetailsRequested() ? strprintf(" - services %s", FormatServices(networkinfo["localservicesnames"])) : ""}; + std::string result{strprintf("%s client %s%s - server %i%s%s\n\n", CLIENT_NAME, FormatFullVersion(), ChainToString(), networkinfo["protocolversion"].getInt(), networkinfo["subversion"].get_str(), services)}; // Report detailed peer connections list sorted by direction and minimum ping time. if (DetailsRequested() && !m_peers.empty()) { @@ -664,7 +665,9 @@ public: } // Report local addresses, ports, and scores. - result += strprintf("\n\nLocal services: %s", ServicesList(networkinfo["localservicesnames"])); + if (!DetailsRequested()) { + 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()) {