summaryrefslogtreecommitdiff
path: root/patches/monero/0020-catch-exception-in-queryWalletDevice.patch
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2024-12-04 12:26:45 -0500
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2024-12-04 12:26:45 -0500
commitecc31787c2174a829848aac403bd13e663fe33c3 (patch)
tree7f505dc9bfe9c34c36c5043911be0cfc0d146a8d /patches/monero/0020-catch-exception-in-queryWalletDevice.patch
parent24076c5a32bbec3c77cc996cb74dd08d8077a7e0 (diff)
parent40c1a1bda4b6f125c702f5a37ecc48a6ebec24b8 (diff)
Merge branch 'develop' into zano
Diffstat (limited to 'patches/monero/0020-catch-exception-in-queryWalletDevice.patch')
-rw-r--r--patches/monero/0020-catch-exception-in-queryWalletDevice.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/monero/0020-catch-exception-in-queryWalletDevice.patch b/patches/monero/0020-catch-exception-in-queryWalletDevice.patch
new file mode 100644
index 0000000..1fb2471
--- /dev/null
+++ b/patches/monero/0020-catch-exception-in-queryWalletDevice.patch
@@ -0,0 +1,35 @@
+From d0774a747e7520f6dae3cf90ecbb682395da8c9c Mon Sep 17 00:00:00 2001
+From: cyan <cyjan@mrcyjanek.net>
+Date: Wed, 27 Nov 2024 23:28:32 +0000
+Subject: [PATCH] catch exception in queryWalletDevice
+
+---
+ src/wallet/api/wallet_manager.cpp | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
+index f88bd9e64..c200f52ae 100644
+--- a/src/wallet/api/wallet_manager.cpp
++++ b/src/wallet/api/wallet_manager.cpp
+@@ -213,10 +213,14 @@ bool WalletManagerImpl::verifyWalletPassword(const std::string &keys_file_name,
+
+ bool WalletManagerImpl::queryWalletDevice(Wallet::Device& device_type, const std::string &keys_file_name, const std::string &password, uint64_t kdf_rounds) const
+ {
+- hw::device::device_type type;
+- bool r = tools::wallet2::query_device(type, keys_file_name, password, kdf_rounds);
+- device_type = static_cast<Wallet::Device>(type);
+- return r;
++ try {
++ hw::device::device_type type;
++ bool r = tools::wallet2::query_device(type, keys_file_name, password, kdf_rounds);
++ device_type = static_cast<Wallet::Device>(type);
++ return r;
++ } catch (...) {
++ return false;
++ }
+ }
+
+ std::vector<std::string> WalletManagerImpl::findWallets(const std::string &path)
+--
+2.43.0
+