summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index 8f8ddf2..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-use std::{io, sync::Arc};
-
-use bitcoin::{
- blocks::BlockChain,
- network::{Network, Request},
-};
-use tokio::sync::Mutex;
-
-use crate::ui::Ui;
-
-pub mod ui;
-
-#[tokio::main]
-async fn main() {
- 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;
-
- let me = {
- let net = network
- .lock()
- .await;
- *net.get_me()
- };
-
- let mut ui = Ui::new(Arc::downgrade(&network), me);
-
- loop {
- let mut cmd = String::new();
- io::stdin()
- .read_line(&mut cmd)
- .unwrap();
-
- if let Some(req) = ui
- .cmd(&cmd)
- .await
- {
- Network::broadcast(network.clone(), req).await;
- }
- }
-}