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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user