Skip to content

Commit

Permalink
fix: reload old wallets (#6308)
Browse files Browse the repository at this point in the history
Description
---
This allows older wallets that dont have a type stored in the DB to load
up as software wallets.

Motivation and Context
---
If this type is not stored, either the entire DB is corrupted or its an
older wallet without a type stored.
If the DB is corrupted it would very likely fail earlier, or if not
later. But older correct wallets should not be blocked from booting up

How Has This Been Tested?
---
Manual
  • Loading branch information
SWvheerden authored Apr 26, 2024
1 parent cf579f5 commit 4cc082d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base_layer/wallet/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,10 @@ pub fn read_or_create_wallet_type<T: WalletBackend + 'static>(

match (db_wallet_type, wallet_type) {
(None, None) => {
panic!("Something is very wrong, no wallet type was found in the DB, or provided (on first run)")
// this is most likely an older wallet pre ledger support, lets put it in software
let wallet_type = WalletType::Software;
db.set_wallet_type(wallet_type)?;
Ok(wallet_type)
},
(None, Some(t)) => {
db.set_wallet_type(t)?;
Expand Down

0 comments on commit 4cc082d

Please sign in to comment.