Implemented right way to constrain zone difficulty.

This commit is contained in:
Revertron
2021-03-17 14:55:05 +01:00
parent d8ac1e3c32
commit 1d9833db0f
10 changed files with 95 additions and 36 deletions
+2 -2
View File
@@ -29,12 +29,12 @@ pub struct Block {
}
impl Block {
pub fn new(transaction: Option<Transaction>, pub_key: Bytes, prev_block_hash: Bytes) -> Self {
pub fn new(transaction: Option<Transaction>, pub_key: Bytes, prev_block_hash: Bytes, difficulty: u32) -> Self {
Block {
index: 0,
timestamp: 0,
version: 0,
difficulty: 0,
difficulty,
random: 0,
nonce: 0,
transaction,