mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
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:
parent
cd9a539288
commit
ea4407a919
1 changed files with 4 additions and 1 deletions
|
@ -18,6 +18,7 @@ use std::time;
|
||||||
|
|
||||||
use crate::chain;
|
use crate::chain;
|
||||||
use crate::common::types::{SyncState, SyncStatus};
|
use crate::common::types::{SyncState, SyncStatus};
|
||||||
|
use crate::core::global;
|
||||||
use crate::core::pow::Difficulty;
|
use crate::core::pow::Difficulty;
|
||||||
use crate::grin::sync::body_sync::BodySync;
|
use crate::grin::sync::body_sync::BodySync;
|
||||||
use crate::grin::sync::header_sync::HeaderSync;
|
use crate::grin::sync::header_sync::HeaderSync;
|
||||||
|
@ -87,8 +88,10 @@ impl SyncRunner {
|
||||||
&& head.total_difficulty > Difficulty::zero())
|
&& head.total_difficulty > Difficulty::zero())
|
||||||
|| n > wait_secs
|
|| n > wait_secs
|
||||||
{
|
{
|
||||||
|
if wp.len() > 0 || !global::is_production_mode() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
thread::sleep(time::Duration::from_secs(1));
|
thread::sleep(time::Duration::from_secs(1));
|
||||||
n += 1;
|
n += 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue