Skip to content

Commit

Permalink
proper total difficulty implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed Dec 14, 2023
1 parent 02d36c1 commit 1ab2a23
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions multi-pow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ pub struct Threshold {
pub keccak: U256,
}

// This trait is not fully baked in the Substrate PoW code, so I will not use it for now.
// This trait does not seem to be fully baked in the Substrate PoW code
// But we do need some kind of sinsible impl here so the node can import blocks.
// so I will not use it for now.
impl TotalDifficulty for Threshold {
fn increment(&mut self, _: Threshold) {
// I'm pretty sure we don't do anything interesting with this... Let's see.
fn increment(&mut self, other: Threshold) {
self.md5 += other.md5;
self.sha3 += other.sha3;
self.keccak += other.keccak;
}
}

Expand Down

0 comments on commit 1ab2a23

Please sign in to comment.