Skip to content

Commit

Permalink
Merge branch 'development' into philip-connectivity-callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron Hambly authored Feb 4, 2022
2 parents bc80a84 + cc41f36 commit 103cc94
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ use crate::{

const LOG_TARGET: &str = "c::bn::state_machine_service::states::listening";

/// The length of time to wait for a propagated block when one block behind before proceeding to sync
const ONE_BLOCK_BEHIND_WAIT_PERIOD: Duration = Duration::from_secs(20);

/// This struct contains the info of the peer, and is used to serialised and deserialised.
#[derive(Serialize, Deserialize)]
pub struct PeerMetadata {
Expand Down Expand Up @@ -195,7 +198,7 @@ impl Listening {
if self.is_synced &&
best_metadata.height_of_longest_chain() == local.height_of_longest_chain() + 1 &&
time_since_better_block
.map(|ts: Instant| ts.elapsed() < Duration::from_secs(60))
.map(|ts: Instant| ts.elapsed() < ONE_BLOCK_BEHIND_WAIT_PERIOD)
.unwrap_or(true)
{
if time_since_better_block.is_none() {
Expand Down

0 comments on commit 103cc94

Please sign in to comment.