From d72c15f4339791a7bbdf17e9d827b7b56ca144e4 Mon Sep 17 00:00:00 2001 From: Konstantin Ullrich Date: Wed, 13 Nov 2024 10:44:50 +0100 Subject: use usleep instead of sleep (#88) --- patches/monero/0016-add-dummy-device-for-ledger.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'patches') diff --git a/patches/monero/0016-add-dummy-device-for-ledger.patch b/patches/monero/0016-add-dummy-device-for-ledger.patch index 364d6fd..dddb4b1 100644 --- a/patches/monero/0016-add-dummy-device-for-ledger.patch +++ b/patches/monero/0016-add-dummy-device-for-ledger.patch @@ -234,13 +234,13 @@ index 000000000..fb082694e + MDEBUG("exchange(): waitsForDeviceSend"); + // NOTE: waitsForDeviceSend should be changed by external code + while (waitsForDeviceSend) { -+ sleep(1); ++ usleep(1000); + MDEBUG("exchange(): waitsForDeviceSend (still)"); + } + + MDEBUG("exchange(): waitsForDeviceReceive"); + while (waitsForDeviceReceive) { -+ sleep(1); ++ usleep(1000); + MDEBUG("exchange(): waitsForDeviceReceive (still)"); + } + -- cgit v1.2.3 From c41c4dad9aa5003a914cfb2c528c76386f952665 Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 27 Nov 2024 23:30:18 +0000 Subject: fix queryWalletDevice on corrupted wallets --- ...0020-catch-exception-in-queryWalletDevice.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 patches/monero/0020-catch-exception-in-queryWalletDevice.patch (limited to 'patches') 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 +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(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(type); ++ return r; ++ } catch (...) { ++ return false; ++ } + } + + std::vector WalletManagerImpl::findWallets(const std::string &path) +-- +2.43.0 + -- cgit v1.2.3