mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Fix deprecated futures items (#148)
* Update futures deprecated send item * Update futures deprecated iter item * Fix cargo req for futures
This commit is contained in:
parent
a1f99fbec6
commit
2e819c72aa
5 changed files with 10 additions and 10 deletions
|
@ -17,7 +17,7 @@ grin_pow = { path = "../pow" }
|
|||
secp256k1zkp = { git = "https://github.com/mimblewimble/rust-secp256k1-zkp" }
|
||||
|
||||
env_logger="^0.3.5"
|
||||
futures = "^0.1.9"
|
||||
futures = "^0.1.15"
|
||||
futures-cpupool = "^0.1.3"
|
||||
hyper = { git = "https://github.com/hyperium/hyper" }
|
||||
log = "^0.3"
|
||||
|
|
|
@ -118,7 +118,7 @@ impl Seeder {
|
|||
thread_rng().shuffle(&mut peers[..]);
|
||||
let sz = min(PEER_PREFERRED_COUNT as usize, peers.len());
|
||||
for p in &peers[0..sz] {
|
||||
tx.send(p.addr).unwrap();
|
||||
tx.unbounded_send(p.addr).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ impl Seeder {
|
|||
let sz = min(PEER_PREFERRED_COUNT as usize, peer_addrs.len());
|
||||
for addr in &peer_addrs[0..sz] {
|
||||
debug!("Connecting to seed: {}.", addr);
|
||||
tx.send(*addr).unwrap();
|
||||
tx.unbounded_send(*addr).unwrap();
|
||||
}
|
||||
if peer_addrs.len() == 0 {
|
||||
warn!("No seeds were retrieved.");
|
||||
|
|
|
@ -7,7 +7,7 @@ workspace = ".."
|
|||
[dependencies]
|
||||
bitflags = "^0.7.0"
|
||||
byteorder = "^0.5"
|
||||
futures = "^0.1.9"
|
||||
futures = "^0.1.15"
|
||||
log = "^0.3"
|
||||
net2 = "0.2.0"
|
||||
rand = "^0.3"
|
||||
|
|
|
@ -183,7 +183,7 @@ impl Connection {
|
|||
|
||||
// infinite iterator stream so we repeat the message reading logic until the
|
||||
// peer is stopped
|
||||
let iter = stream::iter(iter::repeat(()).map(Ok::<(), Error>));
|
||||
let iter = stream::iter_ok(iter::repeat(()).map(Ok::<(), Error>));
|
||||
|
||||
// setup the reading future, getting messages from the peer and processing them
|
||||
let recv_bytes = self.received_bytes.clone();
|
||||
|
@ -238,7 +238,7 @@ impl Connection {
|
|||
));
|
||||
data.append(&mut body_data);
|
||||
|
||||
self.outbound_chan.send(data).map_err(
|
||||
self.outbound_chan.unbounded_send(data).map_err(
|
||||
|_| Error::ConnectionClose,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ fn handle_payload(
|
|||
match header.msg_type {
|
||||
Type::Ping => {
|
||||
let data = ser::ser_vec(&MsgHeader::new(Type::Pong, 0))?;
|
||||
sender.send(data).unwrap();
|
||||
sender.unbounded_send(data).unwrap();
|
||||
Ok(None)
|
||||
}
|
||||
Type::Pong => Ok(None),
|
||||
|
@ -156,7 +156,7 @@ fn handle_payload(
|
|||
&MsgHeader::new(Type::Block, body_data.len() as u64),
|
||||
));
|
||||
data.append(&mut body_data);
|
||||
sender.send(data).unwrap();
|
||||
sender.unbounded_send(data).unwrap();
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ fn handle_payload(
|
|||
&MsgHeader::new(Type::Headers, body_data.len() as u64),
|
||||
));
|
||||
data.append(&mut body_data);
|
||||
sender.send(data).unwrap();
|
||||
sender.unbounded_send(data).unwrap();
|
||||
|
||||
Ok(None)
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ fn handle_payload(
|
|||
&MsgHeader::new(Type::PeerAddrs, body_data.len() as u64),
|
||||
));
|
||||
data.append(&mut body_data);
|
||||
sender.send(data).unwrap();
|
||||
sender.unbounded_send(data).unwrap();
|
||||
|
||||
Ok(None)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue