net: Remove async-std dependency and prefer smol.

Also we now take the global executor and keep it around in P2p.
This commit is contained in:
parazyd
2023-08-22 15:02:05 +02:00
parent 15203f1615
commit 0f125fa2db
37 changed files with 371 additions and 1031 deletions

View File

@@ -28,11 +28,11 @@ use darkfi::{
Result,
};
async fn start(executor: Arc<Executor<'_>>, options: ProgramOptions) -> Result<()> {
let p2p = net::P2p::new(options.network_settings).await;
async fn start(executor: Arc<Executor<'static>>, options: ProgramOptions) -> Result<()> {
let p2p = net::P2p::new(options.network_settings, executor.clone()).await;
p2p.clone().start(executor.clone()).await?;
p2p.run(executor).await?;
p2p.clone().start().await?;
p2p.run().await?;
Ok(())
}