Use WabiSabiConfig.MaxRegistrableAmount in GetMaxSuggestedAmount
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -13,6 +13,7 @@ using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Crypto;
using WalletWasabi.Crypto.Randomness;
using WalletWasabi.Crypto.ZeroKnowledge;
+using WalletWasabi.Helpers;
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Backend.Rounds;
@@ -57,7 +58,7 @@ public static class WabiSabiFactory
new InsecureRandom(),
new FeeRate(100m),
new CoordinationFeeRate(0.003m, Money.Zero),
- Money.Zero));
+ Money.Coins(Constants.MaximumNumberOfBitcoins)));
round.MaxVsizeAllocationPerAlice = 11 + 31 + MultipartyTransactionParameters.SharedOverhead;
return round;
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -363,7 +363,7 @@ public partial class Arena : PeriodicRunner
internal virtual Money GetMaxSuggestedAmount()
{
- return RoundHelpers.GetMaxSuggestedAmount(ConnectionConfirmationStartedCounter);
+ return RoundHelpers.GetMaxSuggestedAmount(Config.MaxRegistrableAmount, ConnectionConfirmationStartedCounter);
}
private void TimeoutRounds()

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/RoundHelpers.cs
WalletWasabi/WabiSabi/Backend/Rounds/RoundHelpers.cs
@@ -45,11 +45,11 @@ internal class RoundHelpers
return roundCounterDividerAndMaxAmounts;
}
- public static Money GetMaxSuggestedAmount(int roundCounter)
+ public static Money GetMaxSuggestedAmount(Money maxRegistrableAmount, int roundCounter)
{
if (roundCounter != 0)
{
- foreach (var (divider, maxValue) in RoundCounterDividerAndMaxAmounts)
+ foreach (var (divider, maxValue) in RoundCounterDividerAndMaxAmounts.Where(v => v.MaxValue <= maxRegistrableAmount))
{
if (roundCounter % divider == 0)
{

Use WabiSabiConfig.MaxRegistrableAmount in GetMaxSuggestedAmount