blob: 096b5337dd8bfb74c3c42a5e4582149bfc45e353 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use std::{sync::Arc, thread::sleep, time::Duration};
use bitcoin::{blocks::BlockChain, network::Network};
use tokio::sync::Mutex;
#[tokio::main]
async fn main() {
let bc = Arc::new(Mutex::new(BlockChain::default()));
let network = Network::new(bc).await;
network
.lock()
.await
.broadcast(bitcoin::network::Request::Ibd(None))
.await;
sleep(Duration::from_secs(100));
}
|