mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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:
@@ -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;
|
||||
|
||||
@@ -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'";
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user