From 63fe6fd9ba3d7fe56564543b877a962e3c7eea53 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 7 Nov 2016 12:00:29 +0000 Subject: wallet2_api: allow connection to return "yes, but wrong version" --- src/wallet/api/wallet.cpp | 12 +++++++++--- 1 file changed, 9 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 9a9638b40..f80e38334 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -720,9 +720,15 @@ bool WalletImpl::connectToDaemon() return result; } -bool WalletImpl::connected() const -{ - return m_wallet->check_connection(); +Wallet::ConnectionStatus WalletImpl::connected() const +{ + bool same_version = false; + bool is_connected = m_wallet->check_connection(&same_version); + if (!is_connected) + return Wallet::ConnectionStatus_Disconnected; + if (!same_version) + return Wallet::ConnectionStatus_WrongVersion; + return Wallet::ConnectionStatus_Connected; } void WalletImpl::setTrustedDaemon(bool arg) -- cgit v1.2.3