Skip to content

Commit

Permalink
coded first fork in class
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed May 29, 2024
1 parent 13b7b62 commit 03b2cf1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions multi-pow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,25 @@ impl FromStr for MaxiPosition {
}
}

fn manual_fork_validation(_parent_number: u32, algo: SupportedHashes) -> bool {
fn manual_fork_validation(parent_number: u32, algo: SupportedHashes) -> bool {
use SupportedHashes::*;

const FORK_HEIGHT: u32 = 2100;

// To begin with we only allow md5 hashes for our pow.
// After the fork height this check is skipped so all the hashes become valid.
match algo {
Md5 => true,
Sha3 => false,
Keccak => false,
if parent_number < FORK_HEIGHT {
match algo {
Md5 => true,
Sha3 => false,
Keccak => false,
}
} else {
match algo {
Md5 => true,
Sha3 => true,
Keccak => true,
}
}
}

Expand Down

0 comments on commit 03b2cf1

Please sign in to comment.