mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
fix bitcoin frost wallet restoration
This commit is contained in:
parent
a100e6a15c
commit
cce94676a6
2 changed files with 8 additions and 4 deletions
|
@ -97,7 +97,9 @@ class _RestoreFrostMsWalletViewState
|
|||
),
|
||||
);
|
||||
|
||||
await ref.read(mainDBProvider).isar.writeTxn(() async {
|
||||
await ref.read(mainDBProvider).isar.frostWalletInfo.put(frostInfo);
|
||||
});
|
||||
|
||||
await (wallet as BitcoinFrostWallet).recover(
|
||||
serializedKeys: keys,
|
||||
|
|
|
@ -718,8 +718,9 @@ class BitcoinFrostWallet<T extends FrostCurrency> extends Wallet<T> {
|
|||
if (knownSalts.contains(salt)) {
|
||||
throw Exception("Known frost multisig salt found!");
|
||||
}
|
||||
knownSalts.add(salt);
|
||||
await _updateKnownSalts(knownSalts);
|
||||
List<String> updatedKnownSalts = List<String>.from(knownSalts);
|
||||
updatedKnownSalts.add(salt);
|
||||
await _updateKnownSalts(updatedKnownSalts);
|
||||
} else {
|
||||
// clear cache
|
||||
await electrumXCachedClient.clearSharedTransactionCache(coin: coin);
|
||||
|
@ -1001,8 +1002,9 @@ class BitcoinFrostWallet<T extends FrostCurrency> extends Wallet<T> {
|
|||
.findFirstSync()!;
|
||||
|
||||
Future<void> _updateKnownSalts(List<String> knownSalts) async {
|
||||
await mainDB.isar.writeTxn(() async {
|
||||
final info = frostInfo;
|
||||
|
||||
await mainDB.isar.writeTxn(() async {
|
||||
await mainDB.isar.frostWalletInfo.delete(info.id);
|
||||
await mainDB.isar.frostWalletInfo.put(
|
||||
info.copyWith(knownSalts: knownSalts),
|
||||
|
|
Loading…
Reference in a new issue