Skip to content

Commit d27e9e1

Browse files
authored
Merge pull request #472 from TheBlueMatt/2020-01-net-async-await
Rewrite lightning-net-tokio using async/await and tokio 0.2
2 parents eee9467 + 174ccf5 commit d27e9e1

File tree

4 files changed

+563
-216
lines changed

4 files changed

+563
-216
lines changed

fuzz/src/full_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
384384
3 => {
385385
let peer_id = get_slice!(1)[0];
386386
if !peers.borrow()[peer_id as usize] { return; }
387-
match loss_detector.handler.read_event(&mut Peer{id: peer_id, peers_connected: &peers}, get_slice!(get_slice!(1)[0]).to_vec()) {
387+
match loss_detector.handler.read_event(&mut Peer{id: peer_id, peers_connected: &peers}, get_slice!(get_slice!(1)[0])) {
388388
Ok(res) => assert!(!res),
389389
Err(_) => { peers.borrow_mut()[peer_id as usize] = false; }
390390
}

lightning-net-tokio/Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
[package]
22
name = "lightning-net-tokio"
3-
version = "0.0.2"
3+
version = "0.0.3"
44
authors = ["Matt Corallo"]
55
license = "Apache-2.0"
6+
edition = "2018"
67
description = """
78
Implementation of the rust-lightning network stack using Tokio.
8-
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the nerequired network stack, especially for those already using Tokio.
9+
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
910
"""
1011

1112
[dependencies]
1213
bitcoin = "0.21"
1314
bitcoin_hashes = "0.7"
1415
lightning = { version = "0.0.10", path = "../lightning" }
1516
secp256k1 = "0.15"
16-
tokio-codec = "0.1"
17-
futures = "0.1"
18-
tokio = "0.1"
19-
bytes = "0.4"
17+
tokio = { version = ">=0.2.12", features = [ "io-util", "macros", "rt-core", "sync", "tcp", "time" ] }
18+
19+
[dev-dependencies]
20+
tokio = { version = ">=0.2.12", features = [ "io-util", "macros", "rt-core", "rt-threaded", "sync", "tcp", "time" ] }

0 commit comments

Comments
 (0)