Block status requests while coinjoin response is being processed.
MODIFY
WalletWasabi/Services/CcjClient.cs
WalletWasabi/Services/CcjClient.cs
@@ -93,6 +93,7 @@ namespace WalletWasabi.Services
{
try
{
+ Synchronizer.BlockRequests();
IEnumerable<CcjRunningRoundState> newRoundStates = e.CcjRoundStates;
await ProcessStatusAsync(newRoundStates);
@@ -101,6 +102,10 @@ namespace WalletWasabi.Services
{
Logger.LogWarning<CcjClient>(ex);
}
+ finally
+ {
+ Synchronizer.EnableRequests();
+ }
}
public void Start()

MODIFY
WalletWasabi/Services/WasabiSynchronizer.cs
WalletWasabi/Services/WasabiSynchronizer.cs
@@ -128,6 +128,11 @@ namespace WalletWasabi.Services
}
public TimeSpan MaxRequestIntervalForMixing { get; set; }
+ private long _blockRequests; // There are priority requests in queue.
+
+ public void BlockRequests() => Interlocked.Exchange(ref _blockRequests, 1);
+
+ public void EnableRequests() => Interlocked.Exchange(ref _blockRequests, 0);
public string IndexFilePath { get; private set; }
private List<FilterModel> Index { get; set; }
@@ -236,6 +241,7 @@ namespace WalletWasabi.Services
{
DateTimeOffset lastFeeQueried = DateTimeOffset.UtcNow - feeQueryRequestInterval;
bool ignoreRequestInterval = false;
+ EnableRequests();
while (IsRunning)
{
try
@@ -246,6 +252,11 @@ namespace WalletWasabi.Services
return;
}
+ while (Interlocked.Read(ref _blockRequests) == 1)
+ {
+ await Task.Delay(3000, Cancel.Token);
+ }
+
EstimateSmartFeeMode? estimateMode = null;
TimeSpan elapsed = DateTimeOffset.UtcNow - lastFeeQueried;
if (elapsed >= feeQueryRequestInterval)

Block status requests while coinjoin response is being processed.