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:
Revertron
2021-04-26 21:49:01 +02:00
parent 5677b860e4
commit fcb920e0de
10 changed files with 142 additions and 123 deletions
+2 -2
View File
@@ -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) {