Added some checks to prevent user from mining if last full block is not signed enough.

This commit is contained in:
Revertron
2021-04-18 18:34:32 +02:00
parent dd558464a5
commit f4c17bc15f
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -234,6 +234,17 @@ impl Chain {
None
}
pub fn is_waiting_signers(&self) -> bool {
if let Some(full_block) = &self.last_full_block {
let sign_count = self.height() - full_block.index;
if sign_count < BLOCK_SIGNERS_MIN {
return true;
}
}
false
}
fn delete_transaction(&mut self, index: u64) -> sqlite::Result<()> {
let mut statement = self.db.prepare(SQL_DELETE_DOMAIN)?;
statement.bind(1, index as i64)?;