Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix dial loop and wait_to_add_peer doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Nov 28, 2022
1 parent 7697f69 commit e92dbf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ethers-core/src/utils/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
/// How long we will wait for geth to indicate that it is ready.
const GETH_STARTUP_TIMEOUT_MILLIS: u64 = 10_000;

/// Timeout for waiting for geth's dial loop to start.
/// Timeout for waiting for geth to add a peer.
const GETH_DIAL_LOOP_TIMEOUT: Duration = Duration::new(20, 0);

/// The exposed APIs
Expand Down Expand Up @@ -76,7 +76,7 @@ impl GethInstance {
&self.data_dir
}

/// Blocks until geth adds the specified peer, using [`GETH_DIAL_LOOP_TIMEOUT`] as the timeout.
/// Blocks until geth adds the specified peer, using 20s as the timeout.
pub fn wait_to_add_peer(&mut self, id: H256) -> Result<(), GethInstanceError> {
let mut stderr = self.pid.stderr.as_mut().ok_or(GethInstanceError::NoStderr)?;
let mut err_reader = BufReader::new(&mut stderr);
Expand All @@ -94,7 +94,7 @@ impl GethInstance {
return Ok(())
}
}
Err(GethInstanceError::Timeout("Timed out waiting for dial loop to start".into()))
Err(GethInstanceError::Timeout("Timed out waiting for geth to add a peer".into()))
}
}

Expand Down

0 comments on commit e92dbf6

Please sign in to comment.