Exemplo n.º 1
0
        private bool CanUseBloomDatabase(BlockHeader toBlock, BlockHeader fromBlock)
        {
            // method is designed for convenient debugging

            bool containsRange = _bloomStorage.ContainsRange(fromBlock.Number, toBlock.Number);

            if (!containsRange)
            {
                return(false);
            }

            bool toIsOnMainChain = _blockFinder.IsMainChain(toBlock);

            if (!toIsOnMainChain)
            {
                return(false);
            }

            bool fromIsOnMainChain = _blockFinder.IsMainChain(fromBlock);

            if (!fromIsOnMainChain)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 private bool CanUseBloomDatabase(BlockHeader toBlock, BlockHeader fromBlock) => _bloomStorage.ContainsRange(fromBlock.Number, toBlock.Number) && _blockFinder.IsMainChain(toBlock) && _blockFinder.IsMainChain(fromBlock);