Example #1
0
        public async Task Clean()
        {
            var bound = DateTime.UtcNow.AddDays(-_settings.SpentOutputsExpirationDays);

            do
            {
                var outputs = await _spentOutputRepository.GetOldSpentOutputs(bound, 10);

                if (!outputs.Any())
                {
                    return;
                }
                await _spentOutputRepository.RemoveSpentOutputs(outputs);

                await Task.Delay(500);
            } while (true);
        }
 public Task RemoveSpentOutputs(Transaction transaction)
 {
     return(_spentOutputRepository.RemoveSpentOutputs(transaction.Inputs.Select(o => new Output(o.PrevOut))));
 }