Refactored Chain a lot to make it possible to test.
Added a CPU hard test for Chain, checking all current DB. Added an option to config file to set a count of checked top blocks on start.
This commit is contained in:
+2
-2
@@ -147,7 +147,7 @@ impl Miner {
|
||||
}
|
||||
|
||||
if !signing_waits {
|
||||
if let Ok(context) = context.try_lock() {
|
||||
if let Ok(context) = context.lock() {
|
||||
let keystore = context.get_keystore();
|
||||
// Ask the blockchain if we have to sign something
|
||||
if let Some(block) = context.chain.get_sign_block(&keystore) {
|
||||
@@ -175,7 +175,7 @@ impl Miner {
|
||||
}
|
||||
} else {
|
||||
// If our queue is empty
|
||||
if let Ok(context) = context.try_lock() {
|
||||
if let Ok(context) = context.lock() {
|
||||
let keystore = context.get_keystore();
|
||||
// Ask the blockchain if we have to sign something
|
||||
if let Some(block) = context.chain.get_sign_block(&keystore) {
|
||||
|
||||
Reference in New Issue
Block a user