adjusting difficulty algorithm
This commit is contained in:
parent
413adbf241
commit
a621522170
|
|
@ -114,7 +114,7 @@ async fn create_genesis_block(
|
||||||
|
|
||||||
// Genesis uses the fixed parent hash and launch difficulty.
|
// Genesis uses the fixed parent hash and launch difficulty.
|
||||||
let timestamp = Utc::now().timestamp() as u32;
|
let timestamp = Utc::now().timestamp() as u32;
|
||||||
let next_block_difficulty = 1200000000000000_u64;
|
let next_block_difficulty = 2000000000000000_u64;
|
||||||
let block_struct = UnminedBlock::new(
|
let block_struct = UnminedBlock::new(
|
||||||
timestamp,
|
timestamp,
|
||||||
miner,
|
miner,
|
||||||
|
|
|
||||||
|
|
@ -509,7 +509,7 @@ async fn block_file_context(db: &Db, mut difficulty: u64) -> (String, u32, u64)
|
||||||
let next_number = if genesis_checkup().await {
|
let next_number = if genesis_checkup().await {
|
||||||
current_height + 1
|
current_height + 1
|
||||||
} else {
|
} else {
|
||||||
difficulty = 1200000000000000_u64;
|
difficulty = 2000000000000000_u64;
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ impl Torrent {
|
||||||
}
|
}
|
||||||
blockchain_data.unmined_block.next_block_difficulty
|
blockchain_data.unmined_block.next_block_difficulty
|
||||||
} else {
|
} else {
|
||||||
1200000000000000_u64
|
2000000000000000_u64
|
||||||
};
|
};
|
||||||
let torrent_difficulty = self.info.this_block_difficulty;
|
let torrent_difficulty = self.info.this_block_difficulty;
|
||||||
if blockchain_difficulty == torrent_difficulty {
|
if blockchain_difficulty == torrent_difficulty {
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ impl Block {
|
||||||
// compare the reduced header hash against the previous
|
// compare the reduced header hash against the previous
|
||||||
// block's recorded target difficulty threshold
|
// block's recorded target difficulty threshold
|
||||||
if !genesis_checkup().await {
|
if !genesis_checkup().await {
|
||||||
let difficulty_target = 1200000000000000_u64;
|
let difficulty_target = 2000000000000000_u64;
|
||||||
if hash <= difficulty_target {
|
if hash <= difficulty_target {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue