lightningdevkit / ldk-sample

Sample node implementation using LDK
Apache License 2.0
166 stars 94 forks source link

Make `ldk-sample` `Send` + `Sync` #72

Closed MaxFangX closed 2 years ago

MaxFangX commented 2 years ago

This makes it possible to run ldk-sample in a tokio task, e.g.

#[tokio::main]
pub async fn main() {
    tokio::spawn(async move {
        start_ldk().await;
    })
        .await
        .expect("LDK panicked")
}

Thanks to @johncantrell97 for suggesting to cast to &dyn Listen + Send + Sync.

TheBlueMatt commented 2 years ago

Oops, rustfmt is sad.

MaxFangX commented 2 years ago

Pushed a fix, CI should pass now. Still need approval from you to run it though @TheBlueMatt