Add denomination
MODIFY
HiddenWallet.ChaumianTumbler/Program.cs
HiddenWallet.ChaumianTumbler/Program.cs
@@ -8,6 +8,8 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System.Threading;
+using HiddenWallet.ChaumianTumbler.Denomination;
+using NBitcoin;
namespace HiddenWallet.ChaumianTumbler
{
@@ -18,20 +20,8 @@ namespace HiddenWallet.ChaumianTumbler
#pragma warning restore IDE1006 // Naming Styles
{
var configFilePath = Path.Combine(Global.DataDir, "Config.json");
- if (File.Exists(configFilePath))
- {
- Global.Config = await Config.CreateFromFileAsync(configFilePath, CancellationToken.None);
- }
- else
- {
- Global.Config = new Config(
- inputRegistrationPhaseTimeoutInSeconds: 86400, // one day
- inputConfirmationPhaseTimeoutInSeconds: 60,
- outputRegistrationPhaseTimeoutInSeconds: 60,
- signingPhaseTimeoutInSeconds: 60);
- await Global.Config.ToFileAsync(configFilePath, CancellationToken.None);
- Console.WriteLine($"Config file did not exist. Created at path: {configFilePath}");
- }
+ Global.Config = new Config();
+ await Global.Config.LoadOrCreateDefaultFileAsync(configFilePath, CancellationToken.None);
Global.StateMachine = new TumblerStateMachine();
Global.StateMachineJobCancel = new CancellationTokenSource();

MODIFY
HiddenWallet.ChaumianTumbler/TumblerStateMachine.cs
HiddenWallet.ChaumianTumbler/TumblerStateMachine.cs
@@ -74,7 +74,7 @@ namespace HiddenWallet.ChaumianTumbler
{
using (var cts = CancellationTokenSource.CreateLinkedTokenSource(cancel, _ctsPhaseCancel.Token))
{
- await Task.Delay(TimeSpan.FromSeconds(Global.Config.InputRegistrationPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
+ await Task.Delay(TimeSpan.FromSeconds((int)Global.Config.InputRegistrationPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
}
AdvancePhase();
break;
@@ -83,7 +83,7 @@ namespace HiddenWallet.ChaumianTumbler
{
using (var cts = CancellationTokenSource.CreateLinkedTokenSource(cancel, _ctsPhaseCancel.Token))
{
- await Task.Delay(TimeSpan.FromSeconds(Global.Config.InputConfirmationPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
+ await Task.Delay(TimeSpan.FromSeconds((int)Global.Config.InputConfirmationPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
}
AdvancePhase();
break;
@@ -92,7 +92,7 @@ namespace HiddenWallet.ChaumianTumbler
{
using (var cts = CancellationTokenSource.CreateLinkedTokenSource(cancel, _ctsPhaseCancel.Token))
{
- await Task.Delay(TimeSpan.FromSeconds(Global.Config.OutputRegistrationPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
+ await Task.Delay(TimeSpan.FromSeconds((int)Global.Config.OutputRegistrationPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
}
AdvancePhase();
break;
@@ -101,7 +101,7 @@ namespace HiddenWallet.ChaumianTumbler
{
using (var cts = CancellationTokenSource.CreateLinkedTokenSource(cancel, _ctsPhaseCancel.Token))
{
- await Task.Delay(TimeSpan.FromSeconds(Global.Config.SigningPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
+ await Task.Delay(TimeSpan.FromSeconds((int)Global.Config.SigningPhaseTimeoutInSeconds), cts.Token).ContinueWith(t => { });
}
AdvancePhase();
break;

Add denomination