Implemented multi-threaded CPU-miner.
This commit is contained in:
@@ -19,16 +19,6 @@ impl Blockchain {
|
||||
block
|
||||
}
|
||||
|
||||
pub fn genesis(chain_id: u32, version: u32) -> Block {
|
||||
Block::new(0, Utc::now().timestamp(), chain_id, version, Key::zero32(), None)
|
||||
}
|
||||
|
||||
pub fn make_genesis(&mut self) {
|
||||
let mut genesis = Self::genesis(self.chain_id, self.version);
|
||||
genesis.mine();
|
||||
self.add_block(genesis);
|
||||
}
|
||||
|
||||
pub fn add_block(&mut self, block: Block) {
|
||||
if self.check_block(&block, None) {
|
||||
println!("Adding block:\n{:?}", &block);
|
||||
|
||||
Reference in New Issue
Block a user