add early exit in get_corrected_rent_epoch_on_load (#24331)

This commit is contained in:
Jeff Washington (jwash)
2022-04-15 13:28:16 -05:00
committed by GitHub
parent ba7a2efa66
commit 8c9430359e

View File

@ -347,13 +347,13 @@ impl ExpectedRentCollection {
.contains_key(pubkey) .contains_key(pubkey)
}; };
let rent_epoch = account.rent_epoch(); let rent_epoch = account.rent_epoch();
if possibly_update if possibly_update && rent_epoch == 0 && current_epoch > 1 {
&& rent_epoch == 0 if rewrites_skipped_this_pubkey_this_slot() {
&& current_epoch > 1 return Some(next_epoch);
&& !rewrites_skipped_this_pubkey_this_slot() } else {
{ // we know we're done
// we know we're done return None;
return None; }
} }
// if an account was written >= its rent collection slot within the last epoch worth of slots, then we don't want to update it here // if an account was written >= its rent collection slot within the last epoch worth of slots, then we don't want to update it here