Skip to content
Snippets Groups Projects
Commit e2c28f45 authored by qh11's avatar qh11
Browse files

Update main.rs

parent f22fb42b
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,15 @@ use std::sync::{Arc, Mutex};
use std::thread;
use std::time;
use crate::types::hash::{H256, Hashable};
use crate::types::transaction::SignedTransaction;
use crate::types::block::Header;
use crate::types::block::Block;
use std::time::{SystemTime, UNIX_EPOCH};
use std::collections::HashMap;
fn main() {
// parse command line arguments
let matches = clap_app!(Bitcoin =>
......@@ -81,8 +90,14 @@ fn main() {
worker_ctx.start();
// start the miner
let (miner_ctx, miner, finished_block_chan) = miner::new();
let miner_worker_ctx = miner::worker::Worker::new(&server, finished_block_chan);
let mut temp_blockchain = Blockchain::new();
let mut arc_mutex_blockchain = Arc::new(Mutex::new(temp_blockchain));
let (miner_ctx, miner, finished_block_chan) = miner::new(&arc_mutex_blockchain);
let miner_worker_ctx = miner::worker::Worker::new(&server, finished_block_chan, &arc_mutex_blockchain);
miner_ctx.start();
miner_worker_ctx.start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment