Improve action
MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -542,7 +542,7 @@ namespace WalletWasabi.Blockchain.Keys
public int CountConsecutiveUnusedKeys(bool isInternal)
{
- var keyIndexes = GetKeys(x => (x.IsInternal == isInternal && x.KeyState == KeyState.Clean) || (!x.IsInternal && x.KeyState == KeyState.Locked)).OrderBy(x => x.Index).Select(x => x.Index).ToArray();
+ var keyIndexes = GetKeys(x => x.IsInternal == isInternal && x.KeyState != KeyState.Used).OrderBy(x => x.Index).Select(x => x.Index).ToArray();
var hs = keyIndexes.ToHashSet();
int largerConsecutiveSequence = 0;

Improve action