Exemple #1
0
        private static async Task TryDesperateDequeueAllCoinsAsync()
        {
            try
            {
                if (Interlocked.Read(ref _triedDesperateDequeuing) == 1)
                {
                    return;
                }
                else
                {
                    Interlocked.Increment(ref _triedDesperateDequeuing);
                }

                if (WalletService is null || ChaumianClient is null)
                {
                    return;
                }
                SmartCoin[] enqueuedCoins = WalletService.Coins.Where(x => x.CoinJoinInProgress).ToArray();
                if (enqueuedCoins.Any())
                {
                    Logger.LogWarning("Unregistering coins in CoinJoin process.", nameof(Global));
                    await ChaumianClient.DequeueCoinsFromMixAsync(enqueuedCoins);
                }
            }
            catch (Exception ex)
            {
                Logger.LogWarning(ex, nameof(Global));
            }
        }
Exemple #2
0
        public static async Task DesperateDequeueAllCoinsAsync()
        {
            if (WalletService is null || ChaumianClient is null)
            {
                return;
            }

            SmartCoin[] enqueuedCoins = WalletService.Coins.Where(x => x.CoinJoinInProgress).ToArray();
            if (enqueuedCoins.Any())
            {
                Logger.LogWarning("Unregistering coins in CoinJoin process.", nameof(Global));
                await ChaumianClient.DequeueCoinsFromMixAsync(enqueuedCoins, "Process was signaled to kill.");
            }
        }
Exemple #3
0
        public async Task DesperateDequeueAllCoinsAsync()
        {
            if (WalletService is null || ChaumianClient is null)
            {
                return;
            }

            SmartCoin[] enqueuedCoins = WalletService.Coins.CoinJoinInProcess().ToArray();
            if (enqueuedCoins.Any())
            {
                Logger.LogWarning("Unregistering coins in CoinJoin process.");
                await ChaumianClient.DequeueCoinsFromMixAsync(enqueuedCoins, DequeueReason.ApplicationExit);
            }
        }