Fix db getting deleted on iOS (#2736)

* Fix db getting deleted on iOS

* Fix db getting deleted on iOS and add a patch for users who updated

* remove prints [skip ci]
This commit is contained in:
Omar Hatem
2025-12-15 04:49:51 +02:00
committed by GitHub
parent 1844405a43
commit aea855d023
11 changed files with 36 additions and 15 deletions
+9
View File
@@ -224,6 +224,15 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
snp?.derivationPath ?? electrum_path;
derivationInfo.derivationType ??=
snp?.derivationType ?? DerivationType.electrum;
if (derivationInfo.derivationType == DerivationType.unknown) {
if (snp?.derivationPath == electrum_path || snp?.derivationType == DerivationType.electrum) {
derivationInfo.derivationPath = electrum_path;
derivationInfo.derivationType = DerivationType.electrum;
} else {
derivationInfo.derivationPath = segwit_path;
derivationInfo.derivationType = DerivationType.bip39;
}
}
await derivationInfo.save();
Uint8List? seedBytes = null;
+1
View File
@@ -115,3 +115,4 @@ Map<DerivationType, List<DerivationInfo>> electrum_derivations = {
};
String electrum_path = electrum_derivations[DerivationType.electrum]!.first.derivationPath!;
String segwit_path = "m/84'/0'/0'";
+9
View File
@@ -283,6 +283,15 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
// set the default if not present:
derivationInfo.derivationPath ??= snp?.derivationPath ?? electrum_path;
derivationInfo.derivationType ??= snp?.derivationType ?? DerivationType.electrum;
if (derivationInfo.derivationType == DerivationType.unknown) {
if (snp?.derivationPath == electrum_path || snp?.derivationType == DerivationType.electrum) {
derivationInfo.derivationPath = electrum_path;
derivationInfo.derivationType = DerivationType.electrum;
} else {
derivationInfo.derivationPath = segwit_path;
derivationInfo.derivationType = DerivationType.bip39;
}
}
Uint8List? seedBytes = null;
final mnemonic = keysData.mnemonic;