refactor calculate_rent_result (#26416)

reactor calculate_rent_result
This commit is contained in:
Jeff Washington (jwash) 2022-07-05 16:45:59 -05:00 committed by GitHub
parent d3a14f5b30
commit b7e34aea15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -172,14 +172,14 @@ impl RentCollector {
return RentResult::LeaveAloneNoRent;
}
let epoch_increment = match rent_due {
let new_rent_epoch = match rent_due {
// Rent isn't collected for the next epoch
// Make sure to check exempt status again later in current epoch
RentDue::Exempt => 0,
RentDue::Exempt => self.epoch,
// Rent is collected for next epoch
RentDue::Paying(_) => 1,
RentDue::Paying(_) => self.epoch + 1,
};
RentResult::CollectRent((self.epoch + epoch_increment, rent_due.lamports()))
RentResult::CollectRent((new_rent_epoch, rent_due.lamports()))
}
#[must_use = "add to Bank::collected_rent"]