Fix inconsistent filename and log exception
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -226,14 +226,14 @@ namespace WalletWasabi.Gui
Logger.LogInfo("WalletService started.");
}
CancelWalletServiceInitialization = null; // Must make it null explicitly, because dispose won't make it null.
- Notifier.Current.Start();
+ TransactionNotifier.Current.Start();
}
public static async Task DisposeInWalletDependentServicesAsync()
{
CancelWalletServiceInitialization?.Cancel();
CancelWalletServiceInitialization = null;
- Notifier.Current?.Stop();
+ TransactionNotifier.Current?.Stop();
if (!(WalletService is null))
{

ADD
WalletWasabi.Gui/TransactionNotifier.cs
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.InteropServices;
+using WalletWasabi.Logging;
+using WalletWasabi.Models;
+
+namespace WalletWasabi.Gui
+{
+ internal class TransactionNotifier
+ {
+ public readonly static TransactionNotifier Current = new TransactionNotifier();
+
+ private TransactionNotifier()
+ {
+ }
+
+ public void Start()
+ {
+ Global.WalletService.CoinReceived += OnCoinReceived;
+ }
+
+ public void Stop()
+ {
+ Global.WalletService.CoinReceived -= OnCoinReceived;
+ }
+
+ private void OnCoinReceived(object sender, SmartCoin coin)
+ {
+ try
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = "notify-send",
+ Arguments = $"\"Wasabi Wallet\" \"You have received an incoming transaction {coin.Amount} BTC\"",
+ CreateNoWindow = true
+ });
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = "osascript",
+ Arguments = $"-e display notification \"You have received an incoming transaction {coin.Amount} BTC\" with title \"Wasabi Wallet\"",
+ CreateNoWindow = true
+ });
+ }
+ }
+ catch (Exception ex)
+ {
+ Logger.LogWarning<TransactionNotifier>(ex);
+ }
+ }
+ }
+}

DELETE
WalletWasabi.Gui/TransactionWatcher.cs
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Runtime.InteropServices;
-using WalletWasabi.Models;
-
-namespace WalletWasabi.Gui
-{
- internal class Notifier
- {
- public readonly static Notifier Current = new Notifier();
-
- private Notifier()
- {
- }
-
- public void Start()
- {
- Global.WalletService.CoinReceived += OnCoinReceived;
- }
-
- public void Stop()
- {
- Global.WalletService.CoinReceived -= OnCoinReceived;
- }
-
- private void OnCoinReceived(object sender, SmartCoin coin)
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- {
- Process.Start(new ProcessStartInfo
- {
- FileName = "notify-send",
- Arguments = $"\"Wasabi Wallet\" \"You have received an incoming transaction {coin.Amount} BTC\"",
- CreateNoWindow = true
- });
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- Process.Start(new ProcessStartInfo
- {
- FileName = "osascript",
- Arguments = $"-e display notification \"You have received an incoming transaction {coin.Amount} BTC\" with title \"Wasabi Wallet\"",
- CreateNoWindow = true
- });
- }
- }
- }
-}

Fix inconsistent filename and log exception