Factor locked portion of Bank::update_recent_blockhashes() out to helper
This commit is contained in:
parent
942c019d50
commit
9cc379af6c
|
@ -968,10 +968,9 @@ impl Bank {
|
||||||
total_validator_rewards
|
total_validator_rewards
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_recent_blockhashes(&self) {
|
fn update_recent_blockhashes_locked(&self, locked_blockhash_queue: &BlockhashQueue) {
|
||||||
self.update_sysvar_account(&sysvar::recent_blockhashes::id(), |account| {
|
self.update_sysvar_account(&sysvar::recent_blockhashes::id(), |account| {
|
||||||
let blockhash_queue = self.blockhash_queue.read().unwrap();
|
let recent_blockhash_iter = locked_blockhash_queue.get_recent_blockhashes();
|
||||||
let recent_blockhash_iter = blockhash_queue.get_recent_blockhashes();
|
|
||||||
sysvar::recent_blockhashes::create_account_with_data(
|
sysvar::recent_blockhashes::create_account_with_data(
|
||||||
self.inherit_sysvar_account_balance(account),
|
self.inherit_sysvar_account_balance(account),
|
||||||
recent_blockhash_iter,
|
recent_blockhash_iter,
|
||||||
|
@ -979,6 +978,11 @@ impl Bank {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn update_recent_blockhashes(&self) {
|
||||||
|
let blockhash_queue = self.blockhash_queue.read().unwrap();
|
||||||
|
self.update_recent_blockhashes_locked(&blockhash_queue);
|
||||||
|
}
|
||||||
|
|
||||||
// If the point values are not `normal`, bring them back into range and
|
// If the point values are not `normal`, bring them back into range and
|
||||||
// set them to the last value or 0.
|
// set them to the last value or 0.
|
||||||
fn check_point_value(&self, mut validator_point_value: f64) -> f64 {
|
fn check_point_value(&self, mut validator_point_value: f64) -> f64 {
|
||||||
|
|
Loading…
Reference in New Issue