summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-10-21 09:04:45 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-10-21 09:04:45 +0800
commit87814a5e33375a4118b75fce01f8a7c53ba39a37 (patch)
tree07e5c709d8e4baf4ac6bbdc0b557562a7880beaa /src/main.rs
parentff590ac70e7a858a64d7a4835a22f6d94b31b886 (diff)
fix: p2p connection
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 096b533..0c25725 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-use std::{sync::Arc, thread::sleep, time::Duration};
+use std::{sync::Arc, time::Duration};
use bitcoin::{blocks::BlockChain, network::Network};
use tokio::sync::Mutex;
@@ -10,7 +10,11 @@ async fn main() {
network
.lock()
.await
+ .start();
+ network
+ .lock()
+ .await
.broadcast(bitcoin::network::Request::Ibd(None))
.await;
- sleep(Duration::from_secs(100));
+ tokio::time::sleep(Duration::from_secs(100)).await;
}