Skip to content

Commit

Permalink
Fix miminal validators count when dealing with fisher (paritytech#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu authored and toxotguo committed Jun 21, 2019
1 parent 003deb0 commit 33af71a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Binary file modified cli/src/chainx_runtime.compact.wasm
Binary file not shown.
Binary file not shown.
6 changes: 5 additions & 1 deletion xrml/xmining/staking/src/shifter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ impl<T: Trait> Module<T> {

// Try removing the evil validators first.
let evil_validators = <EvilValidatorsPerSession<T>>::take();
validators.retain(|x| !evil_validators.contains(x));
for evil_val in evil_validators.iter() {
if validators.len() > Self::minimum_validator_count() as usize {
validators.retain(|x| *x != *evil_val);
}
}

// apply good session reward
let mut session_reward = Self::this_session_reward();
Expand Down

0 comments on commit 33af71a

Please sign in to comment.