fix: load() logic to not fail when wownero is last open wallet (#3185)
What changed, and why it matters
This commit changes how the Cake Wallet app handles a failure when opening the last-used wallet. Previously, if that wallet was a Wownero wallet, the app would crash and show an error. Now, the app skips the special error-handling path for Wownero and Haven wallets and instead tries to recover their seed phrases so the user can restore them. It is a bug-fix for a crash/recovery flow, not a security vulnerability fix.
No security action required. Treat as a normal bug-fix review; verify that seed recovery for Wownero/Haven wallets works as intended and does not leak sensitive seed material in logs or crash reports.
Security signals we found
No security-relevant keywords in commit title or message
No cryptographic, authentication, or authorization changes
Exception handling change only
No input validation or sanitization changes
No network or storage changes
Evidence from the diff
The patch modifies WalletLoadingService.load() exception handling. Before, WalletType.wownero errors were immediately rethrown, bypassing seed recovery. Now, both WalletType.wownero and WalletType.haven bypass the Ledger/hardware-wallet error handling and proceed to the corrupted-wallet seed-recovery block. The corruptedWalletsSeeds string is initialized before the branch and gets the wallet type/name/error appended for wownero/haven. The change is defensive and improves recoverability; it does not alter authentication, cryptography, network, or storage security.
Changed components
lib/core/wallet_loading_service.dartInspect captured patch +10 / −7
diff --git a/lib/core/wallet_loading_service.dart b/lib/core/wallet_loading_service.dart
index 029af339..46038122 100644
--- a/lib/core/wallet_loading_service.dart
+++ b/lib/core/wallet_loading_service.dart
@@ -72,15 +72,18 @@ class WalletLoadingService {
return wallet;
} catch (error, stack) {
- if (type == WalletType.wownero) rethrow;
- await ExceptionHandler.resetLastPopupDate();
- final isLedgerError = await ExceptionHandler.isLedgerError(error);
- if (isLedgerError || await requireHardwareWalletConnection(type, name)) rethrow;
- await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
-
+ String corruptedWalletsSeeds = "Corrupted wallets seeds (if retrievable, empty otherwise):";
+
+ if ([WalletType.wownero, WalletType.haven].contains(type)) {
+ corruptedWalletsSeeds += "\n\n$type $name: $error";
+ } else {
+ await ExceptionHandler.resetLastPopupDate();
+ final isLedgerError = await ExceptionHandler.isLedgerError(error);
+ if (isLedgerError || await requireHardwareWalletConnection(type, name)) rethrow;
+ await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
+ }
// try fetching the seeds of the corrupted wallet to show it to the user
- String corruptedWalletsSeeds = "Corrupted wallets seeds (if retrievable, empty otherwise):";
try {
corruptedWalletsSeeds += await _getCorruptedWalletSeeds(name, type);
} catch (e) {
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.