Skip to content

Commit f585172

Browse files
committed
fix mainnet as well
1 parent b576376 commit f585172

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

base_layer/core/src/consensus/consensus_constants.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,30 @@ impl ConsensusConstants {
751751
let mut con_3 = con_2.clone();
752752
con_3.coinbase_min_maturity = 360;
753753
con_3.effective_from_height = 30 * 24 * 7 * 2; // 2 weeks
754+
754755
let mut con_4 = con_3.clone();
756+
con_4.effective_from_height = 15_000;
755757
con_4.coinbase_min_maturity = 180; // 6 hours
756-
con_4.effective_from_height = 30 * 24 * 7 * 3; // 3 weeks
758+
let mut algos = HashMap::new();
759+
algos.insert(PowAlgorithm::Sha3x, PowAlgorithmConstants {
760+
min_difficulty: Difficulty::from_u64(150_000_000_000).expect("valid difficulty"),
761+
max_difficulty: Difficulty::max(),
762+
target_time: 360,
763+
});
764+
algos.insert(PowAlgorithm::RandomXM, PowAlgorithmConstants {
765+
min_difficulty: Difficulty::from_u64(1_200_000).expect("valid difficulty"),
766+
max_difficulty: Difficulty::max(),
767+
target_time: 360,
768+
});
769+
algos.insert(PowAlgorithm::RandomXT, PowAlgorithmConstants {
770+
min_difficulty: Difficulty::from_u64(1_200_000).expect("valid difficulty"),
771+
max_difficulty: Difficulty::max(),
772+
target_time: 360,
773+
});
774+
con_4.blockchain_version = 1;
775+
con_4.valid_blockchain_version_range = 1..=1;
776+
con_4.proof_of_work = algos;
777+
757778
let consensus_constants = vec![con_1, con_2, con_3, con_4];
758779
consensus_constants
759780
}

base_layer/core/src/proof_of_work/monero_rx/helpers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,9 @@ mod test {
13011301
if std::env::var("TARI_NETWORK").is_err() {
13021302
std::env::set_var("TARI_NETWORK", network.as_key_str());
13031303
}
1304+
if Network::get_current_or_user_setting_or_default() != network {
1305+
let _ = Network::set_current(network);
1306+
}
13041307
let current_network = Network::get_current_or_user_setting_or_default();
13051308
if current_network != network {
13061309
panic!("could not set network");

0 commit comments

Comments
 (0)