From ea4407a91949f1a4ae160984b3672333e62b9860 Mon Sep 17 00:00:00 2001 From: Gary Yu Date: Thu, 10 Jan 2019 21:08:51 +0800 Subject: [PATCH] wait_for_min_peers should continue waiting if none connected (#2326) * wait_for_min_peers should continue waiting if none connected * allow no peers to go in non-production mode, such as travis-ci test --- servers/src/grin/sync/syncer.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servers/src/grin/sync/syncer.rs b/servers/src/grin/sync/syncer.rs index 4caa03071..3599da380 100644 --- a/servers/src/grin/sync/syncer.rs +++ b/servers/src/grin/sync/syncer.rs @@ -18,6 +18,7 @@ use std::time; use crate::chain; use crate::common::types::{SyncState, SyncStatus}; +use crate::core::global; use crate::core::pow::Difficulty; use crate::grin::sync::body_sync::BodySync; use crate::grin::sync::header_sync::HeaderSync; @@ -87,7 +88,9 @@ impl SyncRunner { && head.total_difficulty > Difficulty::zero()) || n > wait_secs { - break; + if wp.len() > 0 || !global::is_production_mode() { + break; + } } thread::sleep(time::Duration::from_secs(1)); n += 1;