public async Task <IEnumerable <IOutput> > GetUnspentOutputs(IEnumerable <IOutput> outputs)
        {
            var enumerable = outputs.ToArray();
            var ids        = enumerable.Select(x => OutputEntity.GenerateId(x.TransactionHash, x.N)).ToArray();

            var hs = new HashSet <string>();

            while (ids.Any())
            {
                var part = ids.Take(200).ToArray();

                var dbOutputs = await _storage.GetDataAsync(o => part.Contains(o.BsonId));

                hs.UnionWith(dbOutputs.Select(x => x.BsonId));

                ids = ids.Skip(200).ToArray();
            }

            return(enumerable.Where(x => !hs.Contains(OutputEntity.GenerateId(x.TransactionHash, x.N))));
        }
 public async Task RemoveSpentOutputs(IEnumerable <IOutput> outputs)
 {
     var ids = outputs.Select(x => OutputEntity.GenerateId(x.TransactionHash, x.N)).ToArray();
     await _storage.DeleteAsync(o => ids.Contains(o.BsonId));
 }