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
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -401,11 +401,9 @@ 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)
}
}
true
}
Err(ref e) if e.is_bad_data() => {