Browse Source

council - rewards saturated arithmetic III

ondratra 4 years ago
parent
commit
e02d2db9f2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      runtime-modules/council/src/lib.rs

+ 2 - 0
runtime-modules/council/src/lib.rs

@@ -739,6 +739,8 @@ impl<T: Trait> Calculations<T> {
         reward_per_block: Balance<T>,
         now: T::BlockNumber,
     ) -> Balance<T> {
+        // calculate currently unpaid reward for elected council member
+        // previously_unpaid_reward + (current_block_number - last_payment_block_number) * reward_per_block
         council_member.unpaid_reward.saturating_add(
             now.saturating_sub(council_member.last_payment_block)
                 .saturated_into()