Remove `SetNetwork` method
The network is always settled and never changes so, the method was redundant.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -81,7 +81,6 @@ public partial class RecoverWalletViewModel : RoutableViewModel
MinGapLimit);
result.AutoCoinJoin = true;
- result.SetNetwork(Services.WalletManager.Network);
// Set the filepath but we will only write the file later when the Ui workflow is done.
result.SetFilePath(walletFilePath);

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -678,15 +678,6 @@ public class KeyManager
return res;
}
- public void SetNetwork(Network network)
- {
- lock (BlockchainStateLock)
- {
- BlockchainState.Network = network;
- ToFileNoBlockchainStateLock();
- }
- }
-
public Network GetNetwork()
{
lock (BlockchainStateLock)

MODIFY
WalletWasabi/Blockchain/Keys/WalletGenerator.cs
WalletWasabi/Blockchain/Keys/WalletGenerator.cs
@@ -32,9 +32,10 @@ public class WalletGenerator
// Here we are not letting anything that will be autocorrected later. We need to generate the wallet exactly with the entered password because of compatibility.
PasswordHelper.Guard(password);
- var km = mnemonic is null ? KeyManager.CreateNew(out mnemonic, password, Network) : KeyManager.CreateNew(mnemonic, password, Network);
+ var km = mnemonic is null
+ ? KeyManager.CreateNew(out mnemonic, password, Network)
+ : KeyManager.CreateNew(mnemonic, password, Network);
km.AutoCoinJoin = true;
- km.SetNetwork(Network);
km.SetBestHeight(new Height(TipHeight));
km.SetFilePath(walletFilePath);
return (km, mnemonic);

Remove `SetNetwork` method

The network is always settled and never changes so, the method was redundant.