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)); } }
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."); } }
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); } }