Merge rust-bitcoin/rust-bitcoin#1119: Use `listener.accept()`
b1faf63e82
Use listener.accept() (Tobin C. Harding) Pull request description: During test network simulation we only accept a single connection, we can simplify the code by using `accept`. Done as a follow up to review suggestion: https://github.com/rust-bitcoin/rust-bitcoin/pull/1042#discussion_r898013799 ACKs for top commit: Kixunil: ACKb1faf63e82
apoelstra: ACKb1faf63e82
Tree-SHA512: b2ead15d3108db3e01d9faab5e3521403dad6a0f4c3cf505f88fefd020110c520a89b9406484c10b04c9a34073c8abc465941577b17b5a193b54502c23b14c61
This commit is contained in:
commit
0469838648
|
@ -193,7 +193,7 @@ mod test {
|
||||||
// in async mode
|
// in async mode
|
||||||
let handle = thread::spawn(move || {
|
let handle = thread::spawn(move || {
|
||||||
// We only simulate a single connection.
|
// We only simulate a single connection.
|
||||||
let mut ostream = listener.incoming().next().unwrap().unwrap();
|
let (mut ostream, _) = listener.accept().unwrap();
|
||||||
for piece in pieces {
|
for piece in pieces {
|
||||||
ostream.write_all(&piece[..]).unwrap();
|
ostream.write_all(&piece[..]).unwrap();
|
||||||
ostream.flush().unwrap();
|
ostream.flush().unwrap();
|
||||||
|
|
Loading…
Reference in New Issue