aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-07 12:00:29 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-07 12:00:29 +0000
commit63fe6fd9ba3d7fe56564543b877a962e3c7eea53 (patch)
treeb78d8c122757a2fc8581c8fc0eb8e62084c01f18 /src/wallet/api/wallet.cpp
parent1372f255af12564d41d8a9bbe247ce7b0fda78be (diff)
downloadmonzero-core-63fe6fd9ba3d7fe56564543b877a962e3c7eea53.tar.gz
monzero-core-63fe6fd9ba3d7fe56564543b877a962e3c7eea53.tar.xz
monzero-core-63fe6fd9ba3d7fe56564543b877a962e3c7eea53.zip
wallet2_api: allow connection to return "yes, but wrong version"
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r--src/wallet/api/wallet.cpp10
1 files changed, 8 insertions, 2 deletions
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
+Wallet::ConnectionStatus WalletImpl::connected() const
{
- return m_wallet->check_connection();
+ 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)