Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Quick fix for missing tree route blocks (#2400)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar authored Sep 29, 2016
1 parent 63d3a4d commit e298ab3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sync/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,10 @@ impl ChainSync {
let mut rlp_stream = RlpStream::new_list(blocks.len());
for block_hash in blocks {
let mut hash_rlp = RlpStream::new_list(2);
let number = HeaderView::new(&chain.block_header(BlockID::Hash(block_hash.clone()))
.expect("chain.tree_route and chain.find_uncles only return hahses of blocks that are in the blockchain. qed.")).number();
let number = match chain.block_header(BlockID::Hash(block_hash.clone())) {
Some(header) => HeaderView::new(&header).number(),
_ => return None,
};
hash_rlp.append(&block_hash);
hash_rlp.append(&number);
rlp_stream.append_raw(hash_rlp.as_raw(), 1);
Expand Down

0 comments on commit e298ab3

Please sign in to comment.