Make sure to do it in wallet recovery, too.
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
@@ -73,7 +73,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
PasswordHelper.Guard(Password); // Here we are not letting anything that will be autocorrected later. We need to generate the wallet exactly with the entered password bacause of compatibility.
var km = KeyManager.CreateNew(out Mnemonic mnemonic, Password);
- km.SetBlockchainState(Global.Network, new Height(Global.BitcoinStore.SmartHeaderChain.TipHeight));
+ km.SetNetwork(Global.Network);
+ km.SetBestHeight(new Height(Global.BitcoinStore.SmartHeaderChain.TipHeight));
km.SetFilePath(walletFilePath);
km.ToFile();

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -77,7 +77,10 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
try
{
var mnemonic = new Mnemonic(MnemonicWords);
- KeyManager.Recover(mnemonic, Password, walletFilePath, keyPath, MinGapLimit);
+ var km = KeyManager.Recover(mnemonic, Password, filePath: null, keyPath, MinGapLimit);
+ km.SetNetwork(Global.Network);
+ km.SetFilePath(walletFilePath);
+ km.ToFile();
NotificationHelpers.Success("Wallet is successfully recovered!");

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -675,12 +675,11 @@ namespace WalletWasabi.Blockchain.Keys
return res;
}
- public void SetBlockchainState(Network network, Height height)
+ public void SetNetwork(Network network)
{
lock (BlockchainStateLock)
{
BlockchainState.Network = network;
- BlockchainState.Height = height;
ToFileNoBlockchainStateLock();
}
}

Make sure to do it in wallet recovery, too.