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.
This commit is contained in:
moneromooo-monero 2016-11-26 12:53:33 +00:00
parent c36cb54340
commit d6086f5b4e
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 30 additions and 16 deletions

View file

@ -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;
}