diff options
author | luigi1111 <luigi1111w@gmail.com> | 2020-04-21 08:52:57 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2020-04-21 08:52:57 -0500 |
commit | cc91c0221ded1766c71c1c877493a3c7dadef106 (patch) | |
tree | b336c9249413c1957e09648999cf46068ef7d51e /src/wallet/api/wallet_manager.cpp | |
parent | Merge pull request #6414 (diff) | |
parent | wallet_api: checkUpdate - optional version and buildtag params (diff) | |
download | monero-cc91c0221ded1766c71c1c877493a3c7dadef106.tar.xz |
Merge pull request #6415
09abca7 wallet_api: checkUpdate - optional version and buildtag params (xiphon)
Diffstat (limited to 'src/wallet/api/wallet_manager.cpp')
-rw-r--r-- | src/wallet/api/wallet_manager.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp index 44a184304..8d7541cea 100644 --- a/src/wallet/api/wallet_manager.cpp +++ b/src/wallet/api/wallet_manager.cpp @@ -342,22 +342,30 @@ std::string WalletManagerImpl::resolveOpenAlias(const std::string &address, bool return addresses.front(); } -std::tuple<bool, std::string, std::string, std::string, std::string> WalletManager::checkUpdates(const std::string &software, std::string subdir) +std::tuple<bool, std::string, std::string, std::string, std::string> WalletManager::checkUpdates( + const std::string &software, + std::string subdir, + const char *buildtag/* = nullptr*/, + const char *current_version/* = nullptr*/) { + if (buildtag == nullptr) + { #ifdef BUILD_TAG - static const char buildtag[] = BOOST_PP_STRINGIZE(BUILD_TAG); + static const char buildtag_default[] = BOOST_PP_STRINGIZE(BUILD_TAG); #else - static const char buildtag[] = "source"; - // Override the subdir string when built from source - subdir = "source"; + static const char buildtag_default[] = "source"; + // Override the subdir string when built from source + subdir = "source"; #endif + buildtag = buildtag_default; + } std::string version, hash; MDEBUG("Checking for a new " << software << " version for " << buildtag); if (!tools::check_updates(software, buildtag, version, hash)) return std::make_tuple(false, "", "", "", ""); - if (tools::vercmp(version.c_str(), MONERO_VERSION) > 0) + if (tools::vercmp(version.c_str(), current_version != nullptr ? current_version : MONERO_VERSION) > 0) { std::string user_url = tools::get_update_url(software, subdir, buildtag, version, true); std::string auto_url = tools::get_update_url(software, subdir, buildtag, version, false); |