description for prepare_block_blooms_update function

This commit is contained in:
debris 2016-02-27 19:17:29 +01:00
parent 1d19196299
commit 1cc719d413

View File

@ -588,7 +588,20 @@ impl BlockChain {
/// This functions returns modified blocks blooms. /// This functions returns modified blocks blooms.
/// ///
/// TODO: this function needs comprehensive description. /// To accelerate blooms lookups, blomms are stored in multiple
/// layers (BLOOM_LEVELS, currently 3).
/// ChainFilter is responsible for building and rebuilding these layers.
/// It returns them in HashMap, where values are Blooms and
/// keys are BloomIndexes. BloomIndex represents bloom location on one
/// of these layers.
///
/// To reduce number of queries to databse, block blooms are stored
/// in BlocksBlooms structure which contains info about several
/// (BLOOM_INDEX_SIZE, currently 16) consecutive blocks blooms.
///
/// Later, BloomIndexer is used to map bloom location on filter layer (BloomIndex)
/// to bloom location in database (BlocksBloomLocation).
///
fn prepare_block_blooms_update(&self, block_bytes: &[u8], info: &BlockInfo) -> HashMap<H256, BlocksBlooms> { fn prepare_block_blooms_update(&self, block_bytes: &[u8], info: &BlockInfo) -> HashMap<H256, BlocksBlooms> {
let block = BlockView::new(block_bytes); let block = BlockView::new(block_bytes);
let header = block.header_view(); let header = block.header_view();