mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 04:09:25 +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);
|
||||
});
|
||||
|
||||
final address = await _generateAddress(
|
||||
change: 0,
|
||||
index: kFrostSecureStartingIndex,
|
||||
serializedKeys: serializedKeys,
|
||||
secure: true,
|
||||
);
|
||||
Address? address;
|
||||
int index = kFrostSecureStartingIndex;
|
||||
while (address == null) {
|
||||
try {
|
||||
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]);
|
||||
} catch (e, s) {
|
||||
|
|
Loading…
Reference in a new issue