mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
netinfo: return shortened services, if peers list requested
When the detailed peers list is requested, return the shortened services in the -netinfo header in the same format as the "serv" column, instead of the full names list in the report.
This commit is contained in:
parent
3851960576
commit
724546e28a
1 changed files with 5 additions and 2 deletions
|
@ -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<int>(), 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<int>(), 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.
|
||||
if (!DetailsRequested()) {
|
||||
result += strprintf("\n\nLocal services: %s", ServicesList(networkinfo["localservicesnames"]));
|
||||
}
|
||||
result += "\n\nLocal addresses";
|
||||
const std::vector<UniValue>& local_addrs{networkinfo["localaddresses"].getValues()};
|
||||
if (local_addrs.empty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue