Add safety margin
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -430,9 +430,10 @@ public class CoinJoinClient
return true;
}
- if (RoundStatusUpdater.CoinJoinFeeRateAverages.TryGetValue(FeeRateAverageTimeFrame, out var feeRate))
+ if (RoundStatusUpdater.CoinJoinFeeRateAverages.TryGetValue(FeeRateAverageTimeFrame, out var averageFeeRate))
{
- return roundFeeRate <= feeRate;
+ // 0.5 satoshi difference is allowable, to avoid rounding errors.
+ return roundFeeRate.SatoshiPerByte <= averageFeeRate.SatoshiPerByte + 0.5m;
}
throw new InvalidOperationException($"Could not find average feeRate for timeframe: {FeeRateAverageTimeFrame}.");

Add safety margin