Still need to check if syncing before asking for orphan parent

This commit is contained in:
Ignotus Peverell 2018-03-20 17:50:05 +00:00
parent 7047930b68
commit 22106693f3
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -392,7 +392,7 @@ impl NetToChainAdapter {
Ok(_) => true,
Err(chain::Error::Orphan) => {
// make sure we did not miss the parent block
if !chain.is_orphan(&prev_hash) {
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)