fix frost wallet init address error

This commit is contained in:
julian 2024-11-29 17:05:35 -06:00
parent 9e988b8ba5
commit 925b58be50

View file

@ -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) {