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

Commit

Permalink
Fix warnings in networking (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka authored and gavofyork committed Sep 4, 2018
1 parent e3a70fe commit 2d8b18a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions substrate/network-libp2p/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use futures::{future, Future, stream, Stream};
use futures::sync::{mpsc, oneshot};
use tokio::runtime::current_thread;
use tokio_io::{AsyncRead, AsyncWrite};
use tokio_timer::{Interval, Deadline};
use tokio_timer::{Interval, Timeout};

use custom_proto::{RegisteredProtocol, RegisteredProtocols};
use custom_proto::RegisteredProtocolOutput;
Expand Down Expand Up @@ -689,9 +689,8 @@ fn handle_kademlia_connection(
let next = kademlia_stream
.into_future()
.map_err(|(err, _)| err);
let deadline = Instant::now() + Duration::from_secs(20);

Deadline::new(next, deadline)
Timeout::new(next, Duration::from_secs(20))
.map_err(|err|
// TODO: improve the error reporting here, but tokio-timer's API is bad
IoError::new(IoErrorKind::Other, err)
Expand Down Expand Up @@ -1243,7 +1242,7 @@ fn periodic_updates<Tp, Tid, St, C>(
.map_err(|err| IoError::new(IoErrorKind::Other, err))
});
let ping_start_time = Instant::now();
let fut = Deadline::new(fut, ping_start_time + Duration::from_secs(30))
let fut = Timeout::new_at(fut, ping_start_time + Duration::from_secs(30))
.then(move |val|
match val {
Err(err) => {
Expand Down

0 comments on commit 2d8b18a

Please sign in to comment.