Always target MaxInputsRegistrableByWallet
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -647,14 +647,9 @@ public class CoinJoinClient
Logger.LogDebug($"{nameof(allowedNonPrivateCoins)}: {allowedNonPrivateCoins.Count} coins, valued at {Money.Satoshis(allowedNonPrivateCoins.Sum(x => x.Amount)).ToString(false, true)} BTC.");
- // How many inputs do we want to provide to the mix?
- var utxoCount = allowedNonPrivateCoins.Count + privateCoins.Length;
- var minUtxoCountTarget = (int)((allowedNonPrivateCoins.Sum(x => x.Amount) + privateCoins.Sum(x => x.Amount)) / liquidityClue.Satoshi);
- Logger.LogDebug($"Derived {nameof(minUtxoCountTarget)} from balance and expected liquidity: {minUtxoCountTarget}.");
-
int inputCount = Math.Min(
privateCoins.Length + allowedNonPrivateCoins.Count,
- consolidationMode ? MaxInputsRegistrableByWallet : GetInputTarget(utxoCount, minUtxoCountTarget, rnd));
+ consolidationMode ? MaxInputsRegistrableByWallet : GetInputTarget(rnd));
if (consolidationMode)
{
Logger.LogDebug($"Consolidation mode is on.");
@@ -935,15 +930,11 @@ public class CoinJoinClient
/// Calculates how many inputs are desirable to be registered.
/// Note: random biasing is applied.
/// </summary>
- /// <param name="minUtxoCountTarget">We want to target to have in our wallet minimum this number of UTXOs.</param>
/// <returns>Desired input count.</returns>
- private static int GetInputTarget(int utxoCount, int minUtxoCountTarget, WasabiRandom rnd)
+ private static int GetInputTarget(WasabiRandom rnd)
{
- // Let's target to have a only 1 UTXO in our wallet, unless it's specified otherwise.
- var utxoCountTarget = Math.Max(1, minUtxoCountTarget);
-
// Until our UTXO count target isn't reached, let's register as few coins as we can to reach it.
- int targetInputCount = utxoCount < utxoCountTarget ? 1 : MaxInputsRegistrableByWallet;
+ int targetInputCount = MaxInputsRegistrableByWallet;
var distance = new Dictionary<int, int>();
for (int i = 1; i <= MaxInputsRegistrableByWallet; i++)

Always target MaxInputsRegistrableByWallet