Logically better order
MODIFY
WalletWasabi/Blockchain/TransactionBuilding/SmartCoinSelector.cs
WalletWasabi/Blockchain/TransactionBuilding/SmartCoinSelector.cs
@@ -31,6 +31,11 @@ public class SmartCoinSelector : ICoinSelector
throw new InsufficientBalanceException(targetMoney, available);
}
+ if (IterationCount > 500)
+ {
+ throw new TimeoutException("Coin selection timed out.");
+ }
+
// This is a hacky safety check to make sure the first few iterations can go through.
if (IterationCount > 10)
{
@@ -41,11 +46,6 @@ public class SmartCoinSelector : ICoinSelector
}
}
- if (IterationCount > 500)
- {
- throw new TimeoutException("Coin selection timed out.");
- }
-
// Get unique clusters.
IEnumerable<Cluster> uniqueClusters = UnspentCoins
.Select(coin => coin.HdPubKey.Cluster)

Logically better order