Add connection confirmation lock
MODIFY
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
@@ -375,6 +375,8 @@ namespace WalletWasabi.Backend.Controllers
return BadRequest();
}
+ using (await CoordinatorRound.ConnectionConfirmationLock.LockAsync())
+ {
(CoordinatorRound round, Alice alice) = GetRunningRoundAndAliceOrFailureResponse(roundId, uniqueId, RoundPhase.ConnectionConfirmation, out IActionResult returnFailureResponse);
if (returnFailureResponse != null)
{
@@ -411,6 +413,7 @@ namespace WalletWasabi.Backend.Controllers
return Ok(resp);
}
+ }
/// <summary>
/// Alice can revoke her registration without penalty if the current phase is InputRegistration.

MODIFY
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
@@ -125,6 +125,7 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
private object RegisteredUnblindedSignaturesLock { get; }
private static AsyncLock RoundSynchronizerLock { get; } = new AsyncLock();
+ public static AsyncLock ConnectionConfirmationLock { get; } = new AsyncLock();
private object PhaseLock { get; }
@@ -334,11 +335,14 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
break;
case RoundPhase.ConnectionConfirmation:
+ {
+ using (await ConnectionConfirmationLock.LockAsync().ConfigureAwait(false))
{
IEnumerable<Alice> alicesToBan = GetAlicesBy(AliceState.InputsRegistered);
await ProgressToOutputRegistrationOrFailAsync(alicesToBan.ToArray()).ConfigureAwait(false);
}
+ }
break;
case RoundPhase.OutputRegistration:

Add connection confirmation lock