Make RoundStateAwaiter simpler
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -66,8 +66,9 @@ public class CoinJoinClient
{
var currentRoundState = await RoundStatusUpdater
.CreateRoundAwaiter(
- Phase.InputRegistration,
- roundState => roundState.InputRegistrationEnd - DateTimeOffset.UtcNow > DoNotRegisterInLastMinuteTimeLimit,
+ roundState =>
+ roundState.InputRegistrationEnd - DateTimeOffset.UtcNow > DoNotRegisterInLastMinuteTimeLimit &&
+ roundState.Phase == Phase.InputRegistration,
cancellationToken)
.ConfigureAwait(false);
@@ -90,7 +91,9 @@ public class CoinJoinClient
var blameRoundState = await RoundStatusUpdater
.CreateRoundAwaiter(
- roundState => roundState.BlameOf == currentRoundState.Id && roundState.Phase == Phase.InputRegistration,
+ roundState =>
+ roundState.BlameOf == currentRoundState.Id &&
+ roundState.Phase == Phase.InputRegistration,
linkedTokenSource.Token)
.ConfigureAwait(false);
currentRoundState = blameRoundState;

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -31,7 +31,7 @@ public class CoinJoinManager : BackgroundService
public ServiceConfiguration ServiceConfiguration { get; }
private ImmutableDictionary<string, CoinJoinTracker> TrackedCoinJoins { get; set; } = ImmutableDictionary<string, CoinJoinTracker>.Empty;
private CoinRefrigerator CoinRefrigerator { get; } = new();
- private TimeSpan AutoCoinJoinDelayAfterWalletLoaded { get; } = TimeSpan.FromMinutes(Random.Shared.Next(5, 16));
+ private TimeSpan AutoCoinJoinDelayAfterWalletLoaded { get; } = TimeSpan.FromMinutes(0);
public bool IsUserInSendWorkflow { get; set; }
public CoinJoinClientState HighestCoinJoinClientState

MODIFY
WalletWasabi/WabiSabi/Client/RoundStateUpdater.cs
WalletWasabi/WabiSabi/Client/RoundStateUpdater.cs
@@ -78,11 +78,6 @@ public class RoundStateUpdater : PeriodicRunner
return CreateRoundAwaiter(null, phase, null, cancellationToken);
}
- public Task<RoundState> CreateRoundAwaiter(Phase phase, Predicate<RoundState> predicate, CancellationToken cancellationToken)
- {
- return CreateRoundAwaiter(null, phase, predicate, cancellationToken);
- }
-
public override Task StopAsync(CancellationToken cancellationToken)
{
lock (AwaitersLock)

Make RoundStateAwaiter simpler