Fix recently introduced sync bugs

This commit is contained in:
Paul Hauner
2019-06-07 02:55:16 -04:00
parent 4cecf05198
commit 719dd72de6
5 changed files with 179 additions and 130 deletions

View File

@@ -166,7 +166,7 @@ impl<T: BeaconChainTypes> ImportQueue<T> {
let mut required_bodies: Vec<Hash256> = vec![];
for header in headers {
let block_root = Hash256::from_slice(&header.tree_hash_root()[..]);
let block_root = Hash256::from_slice(&header.canonical_root()[..]);
if self.chain_has_not_seen_block(&block_root) {
self.insert_header(block_root, header, sender.clone());
@@ -250,7 +250,7 @@ impl<T: BeaconChainTypes> ImportQueue<T> {
///
/// If the partial already existed, the `inserted` time is set to `now`.
fn insert_full_block(&mut self, block: BeaconBlock, sender: PeerId) {
let block_root = Hash256::from_slice(&block.tree_hash_root()[..]);
let block_root = Hash256::from_slice(&block.canonical_root()[..]);
let partial = PartialBeaconBlock {
slot: block.slot,