Skip to content

Commit 289d80b

Browse files
committed
improve comments
1 parent 5a3ee5d commit 289d80b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

  • substrate/frame/nomination-pools/src

substrate/frame/nomination-pools/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,17 +1300,19 @@ impl<T: Config> RewardPool<T> {
13001300
self.total_commission_pending =
13011301
self.total_commission_pending.saturating_add(new_pending_commission);
13021302

1303-
// Store the total payouts at the time of this update. Total payouts are essentially the
1304-
// entire historical balance of the reward pool, equating to the current balance + the total
1305-
// rewards that have left the pool + the total commission that has left the pool.
1303+
// Total payouts are essentially the entire historical balance of the reward pool, equating
1304+
// to the current balance + the total rewards that have left the pool + the total commission
1305+
// that has left the pool.
13061306
let last_recorded_total_payouts = balance
13071307
.checked_add(&self.total_rewards_claimed.saturating_add(self.total_commission_claimed))
13081308
.ok_or(Error::<T>::OverflowRisk)?;
13091309

1310+
// Store the total payouts at the time of this update.
1311+
//
13101312
// An increase in ED could cause `last_recorded_total_payouts` to decrease but we should not
13111313
// allow that to happen since an already paid out reward cannot decrease. The reward account
1312-
// might go in deficit temporarily if this happens but it will be corrected once new rewards
1313-
// are added to the pool.
1314+
// might go in deficit temporarily in this exceptional case but it will be corrected once
1315+
// new rewards are added to the pool.
13141316
self.last_recorded_total_payouts =
13151317
self.last_recorded_total_payouts.max(last_recorded_total_payouts);
13161318

0 commit comments

Comments
 (0)