add premined pow solution for cuckoo16/UserTesting (#260)

* add premined pow solution for cuckoo16/UserTesting
faster startup time

* only check premined solution on genesis block (height 0)
This commit is contained in:
AntiochP
2017-11-13 10:24:49 -05:00
committed by GitHub
parent 54dbda6bc2
commit 596bbd9b6e
3 changed files with 88 additions and 74 deletions
+9 -5
View File
@@ -68,11 +68,9 @@ impl Chain {
}
}
/// Initializes the blockchain and returns a new Chain instance. Does a
/// check
/// Initializes the blockchain and returns a new Chain instance. Does a check
/// on the current chain head to make sure it exists and creates one based
/// on
/// the genesis block if necessary.
/// on the genesis block if necessary.
pub fn init(
db_root: String,
adapter: Arc<ChainAdapter>,
@@ -96,7 +94,13 @@ impl Chain {
// saving a new tip based on genesis
let tip = Tip::new(gen.hash());
chain_store.save_head(&tip)?;
info!(LOGGER, "Saved genesis block with hash {}", gen.hash());
info!(
LOGGER,
"Saved genesis block with hash: {:?}, nonce: {:?}, pow: {:?}",
gen.hash(),
gen.header.nonce,
gen.header.pow,
);
tip
}
Err(e) => return Err(Error::StoreErr(e, "chain init load head".to_owned())),