Fixed panic on accessing expired node

This commit is contained in:
arkpar 2016-02-14 17:45:00 +01:00
parent 61c52f15a3
commit 38f4a06f1d

View File

@ -471,6 +471,10 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
node.last_attempted = Some(::time::now());
node.endpoint.address
}
else {
debug!("Connection to expired node aborted");
return;
}
};
match TcpStream::connect(&address) {
Ok(socket) => socket,
@ -647,7 +651,7 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
let mut session = match Session::new(h, &self.info.read().unwrap()) {
Ok(s) => s,
Err(e) => {
warn!("Session creation error: {:?}", e);
debug!("Session creation error: {:?}", e);
return;
}
};