Remove RefCell from Header (#8227)

* Cache RLP and header hashes.

* Refactor header - WiP

* Avoid decoding laster header.

* Pre-compute hashes for Sealed/Locked block.

* Use accrue bloom. Closes ##8241
This commit is contained in:
Tomasz Drwięga
2018-04-03 10:01:28 +02:00
committed by Marek Kotewicz
parent d477670cb9
commit 9f775a7673
20 changed files with 300 additions and 233 deletions

View File

@@ -1974,7 +1974,7 @@ impl ChainSync {
fn propagate_new_hashes(&mut self, chain_info: &BlockChainInfo, io: &mut SyncIo, peers: &[PeerId]) -> usize {
trace!(target: "sync", "Sending NewHashes to {:?}", peers);
let mut sent = 0;
let last_parent = &io.chain().best_block_header().parent_hash();
let last_parent = *io.chain().best_block_header().parent_hash();
for peer_id in peers {
sent += match ChainSync::create_new_hashes_rlp(io.chain(), &last_parent, &chain_info.best_block_hash) {
Some(rlp) => {