MCPcopy Create free account
hub / github.com/LUX-Core/lux / FormatSubVersion

Function FormatSubVersion

src/clientversion.cpp:99–113  ·  view source on GitHub ↗

* Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) */

Source from the content-addressed store, hash-verified

97 * Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)
98 */
99std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
100{
101 std::ostringstream ss;
102 ss << "/";
103 ss << name << ":" << FormatVersion(nClientVersion);
104 if (!comments.empty()) {
105 std::vector<std::string>::const_iterator it(comments.begin());
106 ss << "(" << *it;
107 for (++it; it != comments.end(); ++it)
108 ss << "; " << *it;
109 ss << ")";
110 }
111 ss << "/";
112 return ss.str();
113}

Callers 4

AppliesToMeMethod · 0.85
getnetworkinfoFunction · 0.85
PushVersionMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 5

FormatVersionFunction · 0.85
strMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68