bandaid fix xmr/wow address not showing up on recdeive screen on first wallet open after restore from seed

This commit is contained in:
julian 2024-01-18 13:00:50 -06:00
parent fee884cc16
commit 2e679882db
2 changed files with 36 additions and 0 deletions

View file

@ -395,6 +395,24 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface {
walletInfo.address = wallet.walletAddresses.address;
await DB.instance
.add<WalletInfo>(boxName: WalletInfo.boxName, value: walletInfo);
if (walletInfo.address != null) {
final newReceivingAddress = await getCurrentReceivingAddress() ??
Address(
walletId: walletId,
derivationIndex: 0,
derivationPath: null,
value: walletInfo.address!,
publicKey: [],
type: AddressType.cryptonote,
subType: AddressSubType.receiving,
);
await mainDB.updateOrPutAddresses([newReceivingAddress]);
await info.updateReceivingAddress(
newAddress: newReceivingAddress.value,
isar: mainDB.isar,
);
}
cwWalletBase?.close();
cwWalletBase = wallet as MoneroWalletBase;
} catch (e, s) {

View file

@ -444,6 +444,24 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface {
.add<WalletInfo>(boxName: WalletInfo.boxName, value: walletInfo);
cwWalletBase?.close();
cwWalletBase = wallet;
if (walletInfo.address != null) {
final newReceivingAddress = await getCurrentReceivingAddress() ??
Address(
walletId: walletId,
derivationIndex: 0,
derivationPath: null,
value: walletInfo.address!,
publicKey: [],
type: AddressType.cryptonote,
subType: AddressSubType.receiving,
);
await mainDB.updateOrPutAddresses([newReceivingAddress]);
await info.updateReceivingAddress(
newAddress: newReceivingAddress.value,
isar: mainDB.isar,
);
}
} catch (e, s) {
Logging.instance.log("$e\n$s", level: LogLevel.Fatal);
}