MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / FormatSubVersion

Function FormatSubVersion

src/clientversion.cpp:135–150  ·  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

133 * Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)
134 */
135std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments, const char *releaseCharacter)
136{
137 std::ostringstream ss;
138 ss << "/";
139 ss << name << ":" << FormatVersion(nClientVersion) << releaseCharacter;
140 if (!comments.empty())
141 {
142 std::vector<std::string>::const_iterator it(comments.begin());
143 ss << "(" << *it;
144 for(++it; it != comments.end(); ++it)
145 ss << "; " << *it;
146 ss << ")";
147 }
148 ss << "/";
149 return ss.str();
150}
151
152/**
153 * The default Bitcoin XT subversion field according to BIP 14 spec

Callers 3

getnetworkinfoFunction · 0.85
XTSubVersionFunction · 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