Set last accesstime at loading and not at the global.
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -626,15 +626,7 @@ namespace WalletWasabi.Gui
public KeyManager LoadKeyManagerFromFile(string walletFullPath)
{
- KeyManager keyManager;
-
- // Set the LastAccessTime.
- new FileInfo(walletFullPath)
- {
- LastAccessTime = DateTime.Now
- };
-
- keyManager = KeyManager.FromFile(walletFullPath);
+ KeyManager keyManager = KeyManager.FromFile(walletFullPath);
Logger.LogInfo($"Wallet loaded: {Path.GetFileNameWithoutExtension(keyManager.FilePath)}.");
return keyManager;
}

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -152,6 +152,18 @@ namespace WalletWasabi.Blockchain.Keys
return new KeyManager(encryptedSecret, extKey.ChainCode, masterFingerprint, extPubKey, false, AbsoluteMinGapLimit, new BlockchainState(), filePath, keyPath);
}
+ public void SetLastAccessTimeForNow()
+ {
+ if (FilePath is { })
+ {
+ // Set the LastAccessTime.
+ new FileInfo(FilePath)
+ {
+ LastAccessTime = DateTime.Now
+ };
+ }
+ }
+
public static KeyManager CreateNewWatchOnly(ExtPubKey extPubKey, string filePath = null)
{
return new KeyManager(null, null, null, extPubKey, null, AbsoluteMinGapLimit, new BlockchainState(), filePath);

MODIFY
WalletWasabi/Wallets/Wallet.cs
WalletWasabi/Wallets/Wallet.cs
@@ -157,6 +157,8 @@ namespace WalletWasabi.Wallets
State = WalletState.Starting;
InitializingChanged?.Invoke(this, true);
+ KeyManager.SetLastAccessTimeForNow();
+
if (!Synchronizer.IsRunning)
{
throw new NotSupportedException($"{nameof(Synchronizer)} is not running.");

Set last accesstime at loading and not at the global.