Factor locked portion of Bank::update_recent_blockhashes() out to helper
(cherry picked from commit 9cc379af6c
)
This commit is contained in:
committed by
Trent Nelson
parent
141a5928c4
commit
7ca65341e6
@ -829,10 +829,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,
|
||||||
@ -840,6 +839,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_values(
|
fn check_point_values(
|
||||||
|
Reference in New Issue
Block a user