mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-24 11:15:58 +00:00
fix rescans
This commit is contained in:
parent
64b0f23910
commit
95bb47aaf8
1 changed files with 12 additions and 8 deletions
|
@ -698,10 +698,14 @@ class BitcoinFrostWallet<T extends FrostCurrency> extends Wallet<T> {
|
||||||
String? multisigConfig,
|
String? multisigConfig,
|
||||||
}) async {
|
}) async {
|
||||||
if (serializedKeys == null || multisigConfig == null) {
|
if (serializedKeys == null || multisigConfig == null) {
|
||||||
throw Exception(
|
serializedKeys = await getSerializedKeys();
|
||||||
"Failed to recover $runtimeType: "
|
multisigConfig = await getMultisigConfig();
|
||||||
"Missing serializedKeys and/or multisigConfig.",
|
}
|
||||||
);
|
if (serializedKeys == null || multisigConfig == null) {
|
||||||
|
String err = "${info.coinName} wallet ${info.walletId} had null keys/cfg";
|
||||||
|
Logging.instance.log(err, level: LogLevel.Fatal);
|
||||||
|
throw Exception(err);
|
||||||
|
// TODO [prio=low]: handle null keys or config. This should not happen.
|
||||||
}
|
}
|
||||||
|
|
||||||
final coin = info.coin;
|
final coin = info.coin;
|
||||||
|
@ -719,7 +723,7 @@ class BitcoinFrostWallet<T extends FrostCurrency> extends Wallet<T> {
|
||||||
if (!isRescan) {
|
if (!isRescan) {
|
||||||
final salt = frost
|
final salt = frost
|
||||||
.multisigSalt(
|
.multisigSalt(
|
||||||
multisigConfig: multisigConfig,
|
multisigConfig: multisigConfig!,
|
||||||
)
|
)
|
||||||
.toHex;
|
.toHex;
|
||||||
final knownSalts = _getKnownSalts();
|
final knownSalts = _getKnownSalts();
|
||||||
|
@ -735,9 +739,9 @@ class BitcoinFrostWallet<T extends FrostCurrency> extends Wallet<T> {
|
||||||
await mainDB.deleteWalletBlockchainData(walletId);
|
await mainDB.deleteWalletBlockchainData(walletId);
|
||||||
}
|
}
|
||||||
|
|
||||||
final keys = frost.deserializeKeys(keys: serializedKeys);
|
final keys = frost.deserializeKeys(keys: serializedKeys!);
|
||||||
await _saveSerializedKeys(serializedKeys);
|
await _saveSerializedKeys(serializedKeys!);
|
||||||
await _saveMultisigConfig(multisigConfig);
|
await _saveMultisigConfig(multisigConfig!);
|
||||||
|
|
||||||
final addressString = frost.addressForKeys(
|
final addressString = frost.addressForKeys(
|
||||||
network: cryptoCurrency.network == CryptoCurrencyNetwork.main
|
network: cryptoCurrency.network == CryptoCurrencyNetwork.main
|
||||||
|
|
Loading…
Reference in a new issue