コード例 #1
0
        public IEnumerable <SyncBlockInfo> BlockGetIncompleteBlocks()
        {
            // note this field is not indexed
            FilterDefinition <MapBlock> filter = Builders <MapBlock> .Filter.Eq(info => info.SyncComplete, false);

            return(MapBlock.Find(filter).ToList().Select(Convert));
        }
コード例 #2
0
        public IEnumerable <SyncBlockInfo> BlockGetBlockCount(int count)
        {
            FilterDefinition <MapBlock> filter = Builders <MapBlock> .Filter.Exists(info => info.BlockIndex);

            SortDefinition <MapBlock> sort = Builders <MapBlock> .Sort.Descending(info => info.BlockIndex);

            return(MapBlock.Find(filter).Sort(sort).Limit(count).ToList().Select(Convert));
        }
コード例 #3
0
        public SyncBlockInfo BlockGetByHash(string blockHash)
        {
            FilterDefinition <MapBlock> filter = Builders <MapBlock> .Filter.Eq(info => info.BlockHash, blockHash);

            return(MapBlock.Find(filter).ToList().Select(Convert).FirstOrDefault());
        }