* Parses major version from version string. * * Version string is expected to be [any text]:X.X[.X[any text]]. * As an example, Luxcore uses /Luxcore:X.X.X/ version string. So, this function will * return 5 for /Luxcore:5.0.0/ or 0 if it couldn't find ":" or "." delimeters, or if no digits are between * those delimeters, or if string verison is empty * @param cleanVersion Luxcore wallet vers
| 6371 | * @return Major Luxcore major version or 0 |
| 6372 | */ |
| 6373 | int GetMajorVersionFromVersion(const string& cleanVersion) { |
| 6374 | size_t delimPos = cleanVersion.find(":"); |
| 6375 | size_t dotPos = cleanVersion.find(".", delimPos + 1); |
| 6376 | if (delimPos != string::npos && dotPos != string::npos && dotPos < cleanVersion.length()) { |
| 6377 | string strMajorVer = cleanVersion.substr(delimPos + 1, dotPos - delimPos); |
| 6378 | istringstream ss(strMajorVer); |
| 6379 | int majorVersion; |
| 6380 | ss >> majorVersion; |
| 6381 | return majorVersion; |
| 6382 | } else { |
| 6383 | return 0; |
| 6384 | } |
| 6385 | } |
| 6386 | |
| 6387 | static bool ProcessMessage(CNode* pfrom, const string &strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams) |
| 6388 | { |
no test coverage detected