fn consolidate_unlocked(self, current_era: EraIndex) -> Self {
        let mut total = self.total;
        let unlocking = self
            .unlocking
            .into_iter()
            .filter(|chunk| {
                if chunk.era > current_era {
                    true
                } else {
                    total = total.saturating_sub(chunk.value);
                    false
                }
            })
            .collect();
        Self {
            total,
            active: self.active,
            stash: self.stash,
            unlocking,
            claimed_rewards: self.claimed_rewards
        }
    }
/// Remove entries from `unlocking` that are sufficiently old and reduce the
/// total by the sum of their balances.
Remove entries from `unlocking` that are sufficiently old and reduce the
total by the sum of their balances.
Remove entries from ` unlocking ` that are sufficiently old and reduce the total by the sum of their balances .
fn consolidate_unlocked(self, current_era: EraIndex) -> Self {
        let mut total = self.total;
        let unlocking = self
            .unlocking
            .into_iter()
            .filter(|chunk| {
                if chunk.era > current_era {
                    true
                } else {
                    total = total.saturating_sub(chunk.value);
                    false
                }
            })
            .collect();
        Self {
            total,
            active: self.active,
            stash: self.stash,
            unlocking,
            claimed_rewards: self.claimed_rewards
        }
    }
fn consolidate_unlocked ( self , current_era : EraIndex ) -> Self { let mut total = self . total ; let unlocking = self . unlocking . into_iter ( ) . filter ( | chunk | { if chunk . era > current_era { true } else { total = total . saturating_sub ( chunk . value ) ; false } } ) . collect ( ) ; Self { total , active : self . active , stash : self . stash , unlocking , claimed_rewards : self . claimed_rewards } }
Remove entries from `unlocking` that are sufficiently old and reduce the
total by the sum of their balances.
Remove entries from ` unlocking ` that are sufficiently old and reduce the total by the sum of their balances .
self
current_era
EraIndex