Avoid repeating the same successful request.
MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjClientRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjClientRound.cs
@@ -25,6 +25,9 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
public string RoundHash { get; set; }
+ public bool Signed { get; set; }
+ public bool PostedOutput { get; set; }
+
public CcjClientRound(CcjRunningRoundState state)
{
State = Guard.NotNull(nameof(state), state);
@@ -41,6 +44,8 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
RoundHash = null;
AliceClient?.Dispose();
AliceClient = null;
+ Signed = false;
+ PostedOutput = false;
}
}
}

MODIFY
WalletWasabi/Services/CcjClient.cs
WalletWasabi/Services/CcjClient.cs
@@ -270,6 +270,8 @@ namespace WalletWasabi.Services
}
}
else if (ongoingRound.State.Phase == CcjRoundPhase.OutputRegistration)
+ {
+ if (!ongoingRound.PostedOutput)
{
if (ongoingRound.RoundHash == null)
{
@@ -279,10 +281,14 @@ namespace WalletWasabi.Services
using (var bobClient = new BobClient(CcjHostUri, TorSocks5EndPoint))
{
await bobClient.PostOutputAsync(ongoingRound.RoundHash, ongoingRound.ActiveOutput.GetP2wpkhScript(), ongoingRound.UnblindedSignature);
+ ongoingRound.PostedOutput = true;
Logger.LogInfo<AliceClient>($"Round ({ongoingRound.State.RoundId})Bob Posted output.");
}
}
+ }
else if (ongoingRound.State.Phase == CcjRoundPhase.Signing)
+ {
+ if (!ongoingRound.Signed)
{
Transaction unsignedCoinJoin = await ongoingRound.AliceClient.GetUnsignedCoinJoinAsync();
if (NBitcoinHelpers.HashOutpoints(unsignedCoinJoin.Inputs.Select(x => x.PrevOut)) != ongoingRound.RoundHash)
@@ -330,6 +336,8 @@ namespace WalletWasabi.Services
}
await ongoingRound.AliceClient.PostSignaturesAsync(myDic);
+ ongoingRound.Signed = true;
+ }
}
}
catch (Exception ex)

Avoid repeating the same successful request.