Changeset View
Changeset View
Standalone View
Standalone View
src/clientversion.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | if (!comments.empty()) { | ||||
} | } | ||||
ss << ")"; | ss << ")"; | ||||
} | } | ||||
ss << "/"; | ss << "/"; | ||||
return ss.str(); | return ss.str(); | ||||
} | } | ||||
/** | /** | ||||
* Format the subversion field according to BIP 14 spec | * Format the BIP-14 user agent in the form of ClientName:Version | ||||
* (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) | |||||
*/ | */ | ||||
std::string FormatSubVersion(const std::string &name, int nClientVersion, | std::string FormatUserAgent(const std::string &name, int nClientVersion) { | ||||
const std::vector<std::string> &comments) { | |||||
std::ostringstream ss; | std::ostringstream ss; | ||||
ss << name << ":" << FormatVersion(nClientVersion); | ss << name << ":" << FormatVersion(nClientVersion); | ||||
return FormatSubVersionUserAgent(ss.str(), comments); | return ss.str(); | ||||
} | } |