Add overload and remove nullable
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -300,7 +300,7 @@ public static class WabiSabiFactory
TimeSpan.Zero);
// Overwrite Maximum Request Delay parameter but still use the original method.
- mock.Setup(m => m.GetScheduledDates(It.IsAny<int>(), It.IsAny<DateTimeOffset>(), It.IsNotIn<TimeSpan?>(TimeSpan.FromSeconds(1))))
+ mock.Setup(m => m.GetScheduledDates(It.IsAny<int>(), It.IsAny<DateTimeOffset>(), It.IsNotIn(TimeSpan.FromSeconds(1))))
.Returns((int howMany, DateTimeOffset endTime, TimeSpan maximumRequestDelay) => mock.Object.GetScheduledDates(howMany, endTime, TimeSpan.FromSeconds(1)));
mock.CallBase = true;

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -359,13 +359,18 @@ public class CoinJoinClient
await Task.WhenAll(tasks).ConfigureAwait(false);
}
- internal virtual ImmutableList<DateTimeOffset> GetScheduledDates(int howMany, DateTimeOffset endTime, TimeSpan? maximumRequestDelay = null)
+ private ImmutableList<DateTimeOffset> GetScheduledDates(int howMany, DateTimeOffset endTime)
+ {
+ return GetScheduledDates(howMany, endTime, TimeSpan.MaxValue);
+ }
+
+ internal virtual ImmutableList<DateTimeOffset> GetScheduledDates(int howMany, DateTimeOffset endTime, TimeSpan maximumRequestDelay)
{
var remainingTime = endTime - DateTimeOffset.UtcNow;
- if (maximumRequestDelay is { } max && remainingTime > max)
+ if (remainingTime > maximumRequestDelay)
{
- remainingTime = max;
+ remainingTime = maximumRequestDelay;
}
return remainingTime.SamplePoisson(howMany);

Add overload and remove nullable