# Struct ethcore::snapshot::BlockRebuilder [−] [src]

    pub struct BlockRebuilder { /* fields omitted */ }

Rebuilds the blockchain from chunks.

Does basic verification for all blocks, but `PoW` verification for some. Blocks must be fed in-order.

The first block in every chunk is disconnected from the last block in the chunk before it, as chunks may be submitted out-of-order.

After all chunks have been submitted, we "glue" the chunks together.

## Methods

### `impl BlockRebuilder`
[src]

#### `fn new(chain: BlockChain,
db: Arc<Database>,
manifest: &ManifestData)
-> Result<Self, Error>`

Create a new BlockRebuilder.

#### `fn feed(&mut self,
chunk: &[u8],
engine: &Engine,
abort_flag: &AtomicBool)
-> Result<u64, Error>`

Feed the rebuilder an uncompressed block chunk. Returns the number of blocks fed or any errors.

#### `fn finalize(self, canonical: HashMap<u64, H256>) -> Result<(), Error>`

Glue together any disconnected chunks and check that the chain is complete.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)