mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 12:19:24 +00:00
fix frost wallet init address error
This commit is contained in:
parent
9e988b8ba5
commit
925b58be50
1 changed files with 20 additions and 6 deletions
|
@ -85,12 +85,26 @@ class BitcoinFrostWallet<T extends FrostCurrency> extends Wallet<T>
|
||||||
await mainDB.isar.frostWalletInfo.put(frostWalletInfo);
|
await mainDB.isar.frostWalletInfo.put(frostWalletInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
final address = await _generateAddress(
|
Address? address;
|
||||||
change: 0,
|
int index = kFrostSecureStartingIndex;
|
||||||
index: kFrostSecureStartingIndex,
|
while (address == null) {
|
||||||
serializedKeys: serializedKeys,
|
try {
|
||||||
secure: true,
|
address = await _generateAddress(
|
||||||
);
|
change: 0,
|
||||||
|
index: index,
|
||||||
|
serializedKeys: serializedKeys,
|
||||||
|
secure: true,
|
||||||
|
);
|
||||||
|
} on FrostdartException catch (e) {
|
||||||
|
if (e.errorCode == 72) {
|
||||||
|
// rust doesn't like the addressDerivationData
|
||||||
|
index++;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await mainDB.putAddresses([address]);
|
await mainDB.putAddresses([address]);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
|
Loading…
Reference in a new issue