From d6086f5b4ee7b35c006c46d8d69c4fcacabf37e7 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 26 Nov 2016 12:53:33 +0000 Subject: 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. --- src/wallet/api/wallet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wallet/api/wallet.cpp') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 215b61aef..8514abfcd 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -906,11 +906,11 @@ bool WalletImpl::connectToDaemon() Wallet::ConnectionStatus WalletImpl::connected() const { - bool same_version = false; - bool is_connected = m_wallet->check_connection(&same_version); + uint32_t version = 0; + bool is_connected = m_wallet->check_connection(&version); if (!is_connected) return Wallet::ConnectionStatus_Disconnected; - if (!same_version) + if ((version >> 16) != CORE_RPC_VERSION_MAJOR) return Wallet::ConnectionStatus_WrongVersion; return Wallet::ConnectionStatus_Connected; } -- cgit v1.2.3