Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Fix error if no bootstrap nodes got connected
Browse files Browse the repository at this point in the history
  • Loading branch information
bcndanos committed May 15, 2015
1 parent a1910b7 commit ee365bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,11 @@ impl ConnectionManager {
}
let res = Deferred::first_to_promise(1,false,vec_deferred, ControlFlow::ParallelLimit(15)).sync();
match res {
Ok(v) => Ok(v[0].clone()),
Err(_) => Err(io::Error::new(io::ErrorKind::Other, "No bootstrap node got connected"))
Ok(v) => if v.len() > 0 { return Ok(v[0].clone()) },
Err(_) => ()
}
// FIXME: The result should probably be Option<Endpoint>
Err(io::Error::new(io::ErrorKind::Other, "No bootstrap node got connected"))
}

fn listen(&self, port: &Port) -> io::Result<Endpoint> {
Expand Down

0 comments on commit ee365bf

Please sign in to comment.