Cuckoo-miner better merged into Grin (#80)

* Adding cuckoo-miner into grin as a proper dependency now
* Defaulting to using cuckoo-miner
* Updates to tests to use cuckoo_miner by default, (using cuckoo16)
This commit is contained in:
Yeastplume
2017-07-18 20:57:09 +00:00
committed by Ignotus Peverell
parent 40090fcdbc
commit 42376e68bc
17 changed files with 223 additions and 133 deletions
+5 -1
View File
@@ -23,11 +23,14 @@ use core::core::{Block, BlockHeader, Output};
use core::core::target::Difficulty;
use core::core::hash::Hash;
use core::{consensus, genesis, pow};
use core::pow::MiningWorker;
use grin_store;
use pipe;
use store;
use types::*;
/// Helper macro to transform a Result into an Option with None in case
/// of error
macro_rules! none_err {
@@ -78,7 +81,8 @@ impl Chain {
} else {
consensus::DEFAULT_SIZESHIFT
};
pow::pow_size(&mut gen.header, diff, sz as u32).unwrap();
let mut internal_miner = pow::cuckoo::Miner::new(consensus::EASINESS, sz as u32);
pow::pow_size(&mut internal_miner, &mut gen.header, diff, sz as u32).unwrap();
chain_store.save_block(&gen)?;
// saving a new tip based on genesis