diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2022-09-15 16:23:56 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2022-09-15 16:23:56 -0500 |
| commit | 0be63cffa80a66a2b76c77025b2637edb47ac571 (patch) | |
| tree | 75db44fd75f9a7e037ed2325c91e5f0087258991 /src/wallet/api | |
| parent | af4f97bf66282bb2af25b5577d9bcba4d00b00b0 (diff) | |
| parent | 864a78ee5f5db4619c093e0dfb26bd03735d9fb1 (diff) | |
| download | monzero-core-0be63cffa80a66a2b76c77025b2637edb47ac571.tar.gz monzero-core-0be63cffa80a66a2b76c77025b2637edb47ac571.tar.xz monzero-core-0be63cffa80a66a2b76c77025b2637edb47ac571.zip | |
Merge pull request #8544
864a78e wallet2: check wallet compatibility with daemon's hard fork version (j-berman)
Diffstat (limited to 'src/wallet/api')
| -rw-r--r-- | src/wallet/api/wallet.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 807dba33b..470206bc5 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -2173,9 +2173,15 @@ bool WalletImpl::connectToDaemon() Wallet::ConnectionStatus WalletImpl::connected() const { uint32_t version = 0; - m_is_connected = m_wallet->check_connection(&version, NULL, DEFAULT_CONNECTION_TIMEOUT_MILLIS); + bool wallet_is_outdated, daemon_is_outdated = false; + m_is_connected = m_wallet->check_connection(&version, NULL, DEFAULT_CONNECTION_TIMEOUT_MILLIS, &wallet_is_outdated, &daemon_is_outdated); if (!m_is_connected) - return Wallet::ConnectionStatus_Disconnected; + { + if (!m_wallet->light_wallet() && (wallet_is_outdated || daemon_is_outdated)) + return Wallet::ConnectionStatus_WrongVersion; + else + return Wallet::ConnectionStatus_Disconnected; + } // Version check is not implemented in light wallets nodes/wallets if (!m_wallet->light_wallet() && (version >> 16) != CORE_RPC_VERSION_MAJOR) return Wallet::ConnectionStatus_WrongVersion; |
