Improve SetMaxBestHeight
MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -771,8 +771,14 @@ namespace WalletWasabi.Blockchain.Keys
{
lock (BlockchainStateLock)
{
- BlockchainState.Height = Math.Min(BlockchainState.Height, height);
+ var prevHeight = BlockchainState.Height;
+ var newHeight = Math.Min(prevHeight, height);
+ if (prevHeight != newHeight)
+ {
+ BlockchainState.Height = newHeight;
ToFileNoBlockchainStateLock();
+ Logger.LogWarning($"Wallet ({WalletName}) height been set back by {prevHeight - newHeight}. From {prevHeight} to {newHeight}.");
+ }
}
}

Improve SetMaxBestHeight