diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index 71dc2e238..9bcb4c3d7 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -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(); diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index e8d8c3646..ced514aa3 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -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();