Implement missing daemon changes.
MODIFY
WalletWasabi.Gui/CommandLine/Daemon.cs
WalletWasabi.Gui/CommandLine/Daemon.cs
@@ -28,11 +28,7 @@ namespace WalletWasabi.Gui.CommandLine
{
Logger.LogSoftwareStarted("Wasabi Daemon");
- KeyManager keyManager = TryGetKeyManagerFromWalletName(walletName);
- if (keyManager is null)
- {
- return;
- }
+ KeyManager keyManager = Global.WalletManager.GetWalletByName(walletName).KeyManager;
string password = null;
var count = 3;
@@ -86,7 +82,7 @@ namespace WalletWasabi.Gui.CommandLine
return;
}
- KeyManager destinationKeyManager = TryGetKeyManagerFromWalletName(destinationWalletName);
+ KeyManager destinationKeyManager = Global.WalletManager.GetWalletByName(destinationWalletName).KeyManager;
bool isDifferentDestinationSpecified = keyManager.ExtPubKey != destinationKeyManager.ExtPubKey;
if (isDifferentDestinationSpecified)
{
@@ -149,43 +145,6 @@ namespace WalletWasabi.Gui.CommandLine
return Wallet.ChaumianClient.State.AnyCoinsQueued();
}
- public KeyManager TryGetKeyManagerFromWalletName(string walletName)
- {
- try
- {
- KeyManager keyManager = null;
- if (walletName != null)
- {
- try
- {
- keyManager = Global.WalletManager.GetWalletByName(walletName)?.KeyManager;
- }
- catch (FileNotFoundException)
- {
- Logger.LogCritical("The selected wallet does not exist, did you delete it?");
- return null;
- }
- catch (Exception ex)
- {
- Logger.LogCritical(ex);
- return null;
- }
- }
-
- if (keyManager is null)
- {
- Logger.LogCritical("Wallet was not supplied. Add --wallet:WalletName");
- }
-
- return keyManager;
- }
- catch (Exception ex)
- {
- Logger.LogCritical(ex);
- return null;
- }
- }
-
private async Task TryQueueCoinsToMixAsync(string password, int minAnonset = int.MinValue, int maxAnonset = int.MaxValue)
{
try

Implement missing daemon changes.