blob: 156e2839dd34e7cb4064c9a4614b37bff0a16650 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
use std::sync::Arc;
use bitcoin::{
blocks::BlockChain,
network::{Network, Request},
};
use tokio::sync::Mutex;
pub async fn init() -> Arc<Mutex<Network>> {
let bc = Arc::new(Mutex::new(BlockChain::default()));
let network = Network::new(bc).await;
Network::start(network.clone());
Network::broadcast(network.clone(), Request::Ibd(None)).await;
network
}
|