mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 11:29:23 +00:00
fix restoring of xmr/wow wallets during swb restore process
This commit is contained in:
parent
dbf68f2a68
commit
9e988b8ba5
1 changed files with 29 additions and 19 deletions
|
@ -503,31 +503,41 @@ abstract class SWB {
|
||||||
viewOnlyData: viewOnlyData,
|
viewOnlyData: viewOnlyData,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (wallet is MoneroWallet /*|| wallet is WowneroWallet doesn't work.*/) {
|
switch (wallet.runtimeType) {
|
||||||
await wallet.init(isRestore: true);
|
case const (EpiccashWallet):
|
||||||
} else if (wallet is WowneroWallet) {
|
await (wallet as EpiccashWallet).init(isRestore: true);
|
||||||
await wallet.init(isRestore: true);
|
break;
|
||||||
} else {
|
|
||||||
await wallet.init();
|
case const (MoneroWallet):
|
||||||
|
await (wallet as MoneroWallet).init(isRestore: true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case const (WowneroWallet):
|
||||||
|
await (wallet as WowneroWallet).init(isRestore: true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
await wallet.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
int restoreHeight = walletbackup['restoreHeight'] as int? ?? 0;
|
int restoreHeight = walletbackup['restoreHeight'] as int? ?? 0;
|
||||||
if (restoreHeight <= 0) {
|
if (restoreHeight <= 0) {
|
||||||
restoreHeight = walletbackup['storedChainHeight'] as int? ?? 0;
|
if (wallet is EpiccashWallet || wallet is LibMoneroWallet) {
|
||||||
|
restoreHeight = 0;
|
||||||
|
} else {
|
||||||
|
restoreHeight = walletbackup['storedChainHeight'] as int? ?? 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void>? restoringFuture;
|
final Future<void>? restoringFuture;
|
||||||
|
if (wallet is BitcoinFrostWallet) {
|
||||||
if (!(wallet is LibMoneroWallet || wallet is EpiccashWallet)) {
|
restoringFuture = wallet.recover(
|
||||||
if (wallet is BitcoinFrostWallet) {
|
isRescan: false,
|
||||||
restoringFuture = wallet.recover(
|
multisigConfig: multisigConfig!,
|
||||||
isRescan: false,
|
serializedKeys: serializedKeys!,
|
||||||
multisigConfig: multisigConfig!,
|
);
|
||||||
serializedKeys: serializedKeys!,
|
} else {
|
||||||
);
|
restoringFuture = wallet.recover(isRescan: false);
|
||||||
} else {
|
|
||||||
restoringFuture = wallet.recover(isRescan: false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiState?.update(
|
uiState?.update(
|
||||||
|
|
Loading…
Reference in a new issue