Fix exception warning while using rpc
MODIFY
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
@@ -227,8 +227,11 @@ namespace WalletWasabi.Gui.Rpc
var wallet = Global.WalletManager.GetWalletByName(walletName);
ActiveWallet = wallet;
+ if (wallet.State == WalletState.Uninitialized)
+ {
Global.WalletManager.StartWalletAsync(wallet).ConfigureAwait(false);
}
+ }
catch (InvalidOperationException) // wallet not found
{
throw new Exception($"Wallet '{walletName}' not found.");

MODIFY
WalletWasabi/Wallets/WalletManager.cs
WalletWasabi/Wallets/WalletManager.cs
@@ -147,14 +147,6 @@ namespace WalletWasabi.Wallets
return labels;
}
- public Wallet GetFirstOrDefaultWallet()
- {
- lock (Lock)
- {
- return Wallets.Keys.FirstOrDefault(x => x.State == WalletState.Started);
- }
- }
-
public bool AnyWallet()
{
return AnyWallet(x => x.State >= WalletState.Starting);

Fix exception warning while using rpc