Header check before asking previous on orphan not needed. Fast sync now properly keeps the syncing flag on.

This commit is contained in:
Ignotus Peverell
2018-03-27 19:56:09 +01:00
parent 6a6e600e48
commit 09a4c454fa
+2 -4
View File
@@ -401,10 +401,8 @@ impl NetToChainAdapter {
Err(chain::Error::Orphan) => {
// make sure we did not miss the parent block
if !chain.is_orphan(&prev_hash) && !self.currently_syncing.load(Ordering::Relaxed) {
if let Err(_) = chain.get_block_header(&prev_hash) {
debug!(LOGGER, "adapter: process_block: received an orphan block, checking the parent: {:}", prev_hash);
self.request_block_by_hash(prev_hash, &addr)
}
debug!(LOGGER, "adapter: process_block: received an orphan block, checking the parent: {:}", prev_hash);
self.request_block_by_hash(prev_hash, &addr)
}
true
}