コード例 #1
0
        public Task ConfirmParametersAsync(ClassicTumblerParameters parameters, StandardCycle standardCyle)
        {
            var feeRate = ((decimal)parameters.Fee.Satoshi / (decimal)parameters.Denomination.Satoshi) * 100.0m;

            if (standardCyle == null)
            {
                _Output.WriteLine("------");
                _Output.WriteLine("Do you confirm the following non standard tumbler settings? (type 'yes' to accept)");
                _Output.WriteLine("------");
                _Output.WriteLine(parameters.PrettyPrint());
                _Output.WriteLine("--");
                _Output.WriteLine("Tumbler Fee: " + parameters.Fee.ToString() + $" ({feeRate.ToString("0.00")}%)");
                _Output.WriteLine("Denomination: " + parameters.Denomination.ToString());
                var periods = parameters.CycleGenerator.FirstCycle.GetPeriods();
                _Output.WriteLine("Total cycle length: " + (periods.Total.End - periods.Total.Start) + " blocks");
                _Output.WriteLine("------");
                _Output.WriteLine("Do you confirm the following non standard tumbler settings? (type 'yes' to accept)");
            }
            else
            {
                _Output.WriteLine("------");
                _Output.WriteLine("Do you confirm the following standard tumbler settings? (type 'yes' to accept)");
                _Output.WriteLine("------");
                _Output.WriteLine($"Well-known cycle generator: {standardCyle.FriendlyName}");
                _Output.WriteLine("Tumbler Fee: " + parameters.Fee.ToString() + $" ({feeRate.ToString("0.00")}%)");
                _Output.WriteLine("Denomination: " + parameters.Denomination.ToString());
                _Output.WriteLine("Time to tumble the first coin: " + PrettyPrint(standardCyle.GetLength(true)));
                _Output.WriteLine("Time to tumble the following coins: " + PrettyPrint(standardCyle.GetLength(false)));
                _Output.WriteLine($"Peak amount tumbled per day: {standardCyle.CoinsPerDay().ToDecimal(NBitcoin.MoneyUnit.BTC).ToString("0.00")} BTC");
            }
            var response = _Input.ReadLine();

            if (!response.Equals("yes", StringComparison.OrdinalIgnoreCase))
            {
                throw new ClientInteractionException("User refused to confirm the parameters");
            }
            return(Task.CompletedTask);
        }
コード例 #2
0
 public Task ConfirmParametersAsync(ClassicTumblerParameters parameters, StandardCycle standardCyle)
 {
     return(Task.CompletedTask);
 }