* Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) */
| 133 | * Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) |
| 134 | */ |
| 135 | std::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 |