Drop nodes mutex before shuffling result
[dnsseed-rust] / src / peer.rs
index 95028ed5f4bb3e68c97db5724b424a1ac2d71848..9276d082d17bd8fe48281a9dc7d464e82dfc75f5 100644 (file)
@@ -18,7 +18,6 @@ use tokio::timer::Delay;
 use futures::sync::mpsc;
 
 use crate::printer::Printer;
-use crate::timeout_stream::TimeoutStream;
 
 struct BytesCoder<'a>(&'a mut bytes::BytesMut);
 impl<'a> std::io::Write for BytesCoder<'a> {
@@ -92,10 +91,7 @@ impl<'a> codec::Encoder for MsgCoder<'a> {
        }
 }
 
-pub struct Peer {
-       
-}
-
+pub struct Peer {}
 impl Peer {
        pub fn new(addr: SocketAddr, timeout: Duration, printer: &'static Printer) -> impl Future<Error=(), Item=(mpsc::Sender<NetworkMessage>, impl Stream<Item=NetworkMessage, Error=std::io::Error>)> {
                let connect_timeout = Delay::new(Instant::now() + timeout.clone()).then(|_| {
@@ -124,7 +120,7 @@ impl Peer {
                                        start_height: 0,
                                        relay: true,
                                }));
-                               future::ok((sender, TimeoutStream::new(read, timeout)))
+                               future::ok((sender, read))
                        })
        }
 }