Fixed wait for signing mode in miner.
This commit is contained in:
+14
-1
@@ -13,7 +13,7 @@ use crate::blockchain::enums::BlockQuality::*;
|
||||
use crate::blockchain::hash_utils::*;
|
||||
use crate::settings::Settings;
|
||||
use crate::keys::check_public_key_strength;
|
||||
use std::cmp::min;
|
||||
use std::cmp::{min, max};
|
||||
|
||||
const DB_NAME: &str = "blockchain.db";
|
||||
const SQL_CREATE_TABLES: &str = "CREATE TABLE blocks (
|
||||
@@ -329,6 +329,19 @@ impl Chain {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn next_minable_block(&self) -> u64 {
|
||||
match self.last_full_block {
|
||||
None => { self.height() + 1 }
|
||||
Some(ref block) => {
|
||||
if block.index < LOCKER_BLOCK_START {
|
||||
self.height() + 1
|
||||
} else {
|
||||
max(block.index, self.height()) + LOCKER_BLOCK_SIGNS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn max_height(&self) -> u64 {
|
||||
self.max_height
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user