diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-11-26 12:53:33 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-11-26 12:56:44 +0000 |
commit | d6086f5b4ee7b35c006c46d8d69c4fcacabf37e7 (patch) | |
tree | 34a0766edc040231ea6ac90fadab8f937e63cd72 /src/wallet/wallet2.cpp | |
parent | Merge pull request #1372 (diff) | |
download | monero-d6086f5b4ee7b35c006c46d8d69c4fcacabf37e7.tar.xz |
Improve daemon RPC version handling
Daemon RPC version is now composed of a major and minor number,
so that incompatible changes bump the major version, while
compatible changes can still bump the minor version without
causing clients to unnecessarily complain.
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ea3994435..a5444ec14 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2221,7 +2221,7 @@ bool wallet2::prepare_file_names(const std::string& file_path) return true; } //---------------------------------------------------------------------------------------------------- -bool wallet2::check_connection(bool *same_version) +bool wallet2::check_connection(uint32_t *version) { boost::lock_guard<boost::mutex> lock(m_daemon_rpc_mutex); @@ -2239,7 +2239,7 @@ bool wallet2::check_connection(bool *same_version) return false; } - if (same_version) + if (version) { epee::json_rpc::request<cryptonote::COMMAND_RPC_GET_VERSION::request> req_t = AUTO_VAL_INIT(req_t); epee::json_rpc::response<cryptonote::COMMAND_RPC_GET_VERSION::response, std::string> resp_t = AUTO_VAL_INIT(resp_t); @@ -2248,9 +2248,9 @@ bool wallet2::check_connection(bool *same_version) req_t.method = "get_version"; bool r = net_utils::invoke_http_json_remote_command2(m_daemon_address + "/json_rpc", req_t, resp_t, m_http_client); if (!r || resp_t.result.status != CORE_RPC_STATUS_OK) - *same_version = false; + *version = 0; else - *same_version = resp_t.result.version == CORE_RPC_VERSION; + *version = resp_t.result.version; } return true; |