Updates for latest master

This commit is contained in:
Age Manning
2019-06-20 22:43:50 +10:00
parent fc8dc6dfa7
commit cf459b60a9
5 changed files with 21 additions and 46 deletions

View File

@@ -522,30 +522,15 @@ impl<T: BeaconChainTypes> SimpleSync<T> {
BlockProcessingOutcome::ParentUnknown { .. } => {
self.import_queue
.enqueue_full_blocks(vec![block], peer_id.clone());
trace!(
self.log,
"NewGossipBlock";
"peer" => format!("{:?}", peer_id),
);
trace!(
self.log,
"NewGossipBlock";
"peer" => format!("{:?}", peer_id),
);
// Ignore any block from a finalized slot.
if self.slot_is_finalized(block.slot) {
warn!(
self.log, "NewGossipBlock";
"msg" => "new block slot is finalized.",
"block_slot" => block.slot,
);
return false;
}
SHOULD_FORWARD_GOSSIP_BLOCK
}
let block_root = Hash256::from_slice(&block.hash_tree_root());
// Ignore any block that the chain already knows about.
if self.chain_has_seen_block(&block_root) {
println!("this happened");
// TODO: Age confirm that we shouldn't forward a block if we already know of it.
return false;
}
BlockProcessingOutcome::FutureSlot {
present_slot,
block_slot,