fn handle_pool_new_reward(
			pool_info: &mut PoolInfo<T::AccountId, BalanceOf<T>>,
			rewards: BalanceOf<T>,
		) {
			if rewards > Zero::zero() {
				if balance_close_to_zero(pool_info.total_shares) {
					Self::deposit_event(Event::<T>::RewardDismissedNoShare(pool_info.pid, rewards));
					return;
				}
				let commission = pool_info.payout_commission.unwrap_or_default() * rewards;
				pool_info.owner_reward.saturating_accrue(commission);
				let to_distribute = rewards - commission;
				if is_nondust_balance(to_distribute) {
					pool_info.distribute_reward(to_distribute);
				} else if to_distribute > Zero::zero() {
					Self::deposit_event(Event::<T>::RewardDismissedDust(
						pool_info.pid,
						to_distribute,
					));
				}
			}
		}
/// Adds up the newly received reward to `reward_acc`
Adds up the newly received reward to `reward_acc`
Adds up the newly received reward to ` reward_acc `
fn handle_pool_new_reward(
			pool_info: &mut PoolInfo<T::AccountId, BalanceOf<T>>,
			rewards: BalanceOf<T>,
		) {
			if rewards > Zero::zero() {
				if balance_close_to_zero(pool_info.total_shares) {
					Self::deposit_event(Event::<T>::RewardDismissedNoShare(pool_info.pid, rewards));
					return;
				}
				let commission = pool_info.payout_commission.unwrap_or_default() * rewards;
				pool_info.owner_reward.saturating_accrue(commission);
				let to_distribute = rewards - commission;
				if is_nondust_balance(to_distribute) {
					pool_info.distribute_reward(to_distribute);
				} else if to_distribute > Zero::zero() {
					Self::deposit_event(Event::<T>::RewardDismissedDust(
						pool_info.pid,
						to_distribute,
					));
				}
			}
		}
fn handle_pool_new_reward ( pool_info : & mut PoolInfo < T :: AccountId , BalanceOf < T > > , rewards : BalanceOf < T > , ) { if rewards > Zero :: zero ( ) { if balance_close_to_zero ( pool_info . total_shares ) { Self :: deposit_event ( Event :: < T > :: RewardDismissedNoShare ( pool_info . pid , rewards ) ) ; return ; } let commission = pool_info . payout_commission . unwrap_or_default ( ) * rewards ; pool_info . owner_reward . saturating_accrue ( commission ) ; let to_distribute = rewards - commission ; if is_nondust_balance ( to_distribute ) { pool_info . distribute_reward ( to_distribute ) ; } else if to_distribute > Zero :: zero ( ) { Self :: deposit_event ( Event :: < T > :: RewardDismissedDust ( pool_info . pid , to_distribute , ) ) ; } } }
Adds up the newly received reward to `reward_acc`
Adds up the newly received reward to ` reward_acc `
pool_info
&mut PoolInfo<T::AccountId, BalanceOf<T>>
rewards
BalanceOf<T>
pool_info
&mut PoolInfo<T::AccountId, BalanceOf<T>>
rewards
BalanceOf<T>