Advance signing phase
MODIFY
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
@@ -374,12 +374,16 @@ namespace HiddenWallet.ChaumianTumbler.Controllers
}
// check if fully signed
- if(Global.StateMachine.CoinJoin.Inputs.All(x => x.WitScript != default))
+ if(Global.StateMachine.FullySignedCoinJoin)
+ {
+ var failed = true;
+ try
{
var res = await Global.RpcClient.SendCommandAsync(RPCOperations.sendrawtransaction, Global.StateMachine.CoinJoin.ToHex(), true);
var state = CoinJoinTransactionState.Failed;
if (Global.StateMachine.CoinJoin.GetHash().ToString() == res.ToString())
{
+ failed = false;
state = CoinJoinTransactionState.Succeeded;
}
Global.CoinJoinStore.Transactions.Add(new CoinJoinTransaction
@@ -389,9 +393,16 @@ namespace HiddenWallet.ChaumianTumbler.Controllers
State = state
});
await Global.CoinJoinStore.ToFileAsync(Global.CoinJoinStorePath);
-
- // progress round
- throw new NotImplementedException();
+ }
+ finally
+ {
+ if (failed)
+ {
+ Global.StateMachine.FallBackRound = true;
+ }
+ else Global.StateMachine.FallBackRound = false;
+ Global.StateMachine.UpdatePhase(TumblerPhase.InputRegistration);
+ }
}
return new ObjectResult(new SuccessResponse());

MODIFY
HiddenWallet.ChaumianTumbler/TumblerStateMachine.cs
HiddenWallet.ChaumianTumbler/TumblerStateMachine.cs
@@ -26,9 +26,10 @@ namespace HiddenWallet.ChaumianTumbler
public TimeSpan TimeSpentInInputRegistration { get; private set; } = TimeSpan.FromSeconds((int)Global.Config.AverageTimeToSpendInInputRegistrationInSeconds) + TimeSpan.FromSeconds(1); // took one sec longer, so the first round will use the same anonymity set
public bool AcceptRequest { get; private set; } = false;
public Stopwatch InputRegistrationStopwatch { get; private set; }
- public bool FallBackRound { get; private set; } = false;
+ public bool FallBackRound { get; set; } = false;
public Transaction CoinJoin { get; private set; } = null;
+ public bool FullySignedCoinJoin => CoinJoin?.Inputs == null ? false : CoinJoin.Inputs.All(x => x.WitScript != default);
private SmartBitClient SmartBitClient { get; } = new SmartBitClient(Network.Main);
public ConcurrentHashSet<Alice> Alices { get; private set; }
@@ -136,7 +137,10 @@ namespace HiddenWallet.ChaumianTumbler
{
await Task.Delay(TimeSpan.FromSeconds((int)Global.Config.SigningPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
}
- FallBackRound = false;
+ if(!FullySignedCoinJoin)
+ {
+ FallBackRound = true;
+ }
UpdatePhase(TumblerPhase.InputRegistration);
CoinJoin = null;
break;

Advance signing phase