From a621522170d335bcc70faca915d394718db48cab Mon Sep 17 00:00:00 2001 From: viraladmin <00purple@gmail.com> Date: Thu, 4 Jun 2026 21:11:23 -0600 Subject: [PATCH] adjusting difficulty algorithm --- src/miner/genesis.rs | 2 +- src/records/record_chain/save.rs | 2 +- src/verifications/async_funcs/validate_torrent_data.rs | 2 +- src/verifications/async_funcs/verify_block.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/miner/genesis.rs b/src/miner/genesis.rs index 38cb69d..3d493f2 100644 --- a/src/miner/genesis.rs +++ b/src/miner/genesis.rs @@ -114,7 +114,7 @@ async fn create_genesis_block( // Genesis uses the fixed parent hash and launch difficulty. let timestamp = Utc::now().timestamp() as u32; - let next_block_difficulty = 1200000000000000_u64; + let next_block_difficulty = 2000000000000000_u64; let block_struct = UnminedBlock::new( timestamp, miner, diff --git a/src/records/record_chain/save.rs b/src/records/record_chain/save.rs index 3b00a15..9c5fb66 100644 --- a/src/records/record_chain/save.rs +++ b/src/records/record_chain/save.rs @@ -509,7 +509,7 @@ async fn block_file_context(db: &Db, mut difficulty: u64) -> (String, u32, u64) let next_number = if genesis_checkup().await { current_height + 1 } else { - difficulty = 1200000000000000_u64; + difficulty = 2000000000000000_u64; 0 }; diff --git a/src/verifications/async_funcs/validate_torrent_data.rs b/src/verifications/async_funcs/validate_torrent_data.rs index 63e3739..4b646f9 100644 --- a/src/verifications/async_funcs/validate_torrent_data.rs +++ b/src/verifications/async_funcs/validate_torrent_data.rs @@ -134,7 +134,7 @@ impl Torrent { } blockchain_data.unmined_block.next_block_difficulty } else { - 1200000000000000_u64 + 2000000000000000_u64 }; let torrent_difficulty = self.info.this_block_difficulty; if blockchain_difficulty == torrent_difficulty { diff --git a/src/verifications/async_funcs/verify_block.rs b/src/verifications/async_funcs/verify_block.rs index b75c42e..4791d20 100644 --- a/src/verifications/async_funcs/verify_block.rs +++ b/src/verifications/async_funcs/verify_block.rs @@ -186,7 +186,7 @@ impl Block { // compare the reduced header hash against the previous // block's recorded target difficulty threshold if !genesis_checkup().await { - let difficulty_target = 1200000000000000_u64; + let difficulty_target = 2000000000000000_u64; if hash <= difficulty_target { return Ok(()); } else {