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

Function FormatSubVersion

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

85 * Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)
86 */
87std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
88{
89 std::ostringstream ss;
90 ss << "/";
91 ss << name << ":" << FormatVersion(nClientVersion);
92 if (!comments.empty())
93 {
94 std::vector<std::string>::const_iterator it(comments.begin());
95 ss << "(" << *it;
96 for(++it; it != comments.end(); ++it)
97 ss << "; " << *it;
98 ss << ")";
99 }
100 ss << "/";
101 return ss.str();
102}

Callers 2

AppInitMainFunction · 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