fn slash(&mut self, amount: Balance) {
			debug_assert!(
				is_nondust_balance(self.total_shares),
				"No share in the pool. This shouldn't happen."
			);
			debug_assert!(
				self.total_stake >= amount,
				"No enough stake to slash (total = {}, slash = {})",
				self.total_stake,
				amount
			);
			let amount = self.total_stake.min(amount);
			// Note that once the stake reaches zero by slashing (implying the share is non-zero),
			// the pool goes banckrupt. In such case, the pool becomes frozen.
			// (TODO: maybe can be recovered by removing all the miners from the pool? How to take
			// care of PoolUsers?)
			let (new_stake, _) = extract_dust(self.total_stake - amount);
			self.total_stake = new_stake;
		}
/// Slashes the pool with dust removed.
Slashes the pool with dust removed.
Slashes the pool with dust removed .
fn slash(&mut self, amount: Balance) {
			debug_assert!(
				is_nondust_balance(self.total_shares),
				"No share in the pool. This shouldn't happen."
			);
			debug_assert!(
				self.total_stake >= amount,
				"No enough stake to slash (total = {}, slash = {})",
				self.total_stake,
				amount
			);
			let amount = self.total_stake.min(amount);
			// Note that once the stake reaches zero by slashing (implying the share is non-zero),
			// the pool goes banckrupt. In such case, the pool becomes frozen.
			// (TODO: maybe can be recovered by removing all the miners from the pool? How to take
			// care of PoolUsers?)
			let (new_stake, _) = extract_dust(self.total_stake - amount);
			self.total_stake = new_stake;
		}
fn slash ( & mut self , amount : Balance ) { debug_assert ! ( is_nondust_balance ( self total_shares ) " " ) ; debug_assert ! ( self total_stake amount " " self total_stake amount ) ; let amount = self . total_stake . min ( amount ) ; // Note that once the stake reaches zero by slashing (implying the share is non-zero), // the pool goes banckrupt. In such case, the pool becomes frozen. // (TODO: maybe can be recovered by removing all the miners from the pool? How to take // care of PoolUsers?) let ( new_stake , _ ) = extract_dust ( self . total_stake - amount ) ; self . total_stake = new_stake ; }
Slashes the pool with dust removed.
Slashes the pool with dust removed .
&mut self
amount
Balance
&mut self
amount
Balance