fix initial xmr/wow address not showing up on first wallet open

This commit is contained in:
julian 2024-06-04 09:40:45 -06:00
parent 5eb276b6fc
commit 7cef4c45eb
2 changed files with 24 additions and 0 deletions

View file

@ -126,6 +126,18 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface {
await updateNode();
Address? currentAddress = await getCurrentReceivingAddress();
if (currentAddress == null) {
currentAddress = addressFor(index: 0);
await mainDB.updateOrPutAddresses([currentAddress]);
}
if (info.cachedReceivingAddress != currentAddress.value) {
await info.updateReceivingAddress(
newAddress: currentAddress.value,
isar: mainDB.isar,
);
}
await CwBasedInterface.cwWalletBase?.startSync();
unawaited(refresh());
autoSaveTimer?.cancel();

View file

@ -452,6 +452,18 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface {
await updateNode();
Address? currentAddress = await getCurrentReceivingAddress();
if (currentAddress == null) {
currentAddress = addressFor(index: 0);
await mainDB.updateOrPutAddresses([currentAddress]);
}
if (info.cachedReceivingAddress != currentAddress.value) {
await info.updateReceivingAddress(
newAddress: currentAddress.value,
isar: mainDB.isar,
);
}
await (CwBasedInterface.cwWalletBase as WowneroWalletBase?)?.startSync();
unawaited(refresh());
autoSaveTimer?.cancel();