Update get recent blockhashes to return confirmed blockhashes only

This commit is contained in:
Sagar Dhawan
2019-04-12 12:03:02 -07:00
committed by Grimes
parent 1dac4c33b8
commit 1db80d79fc
3 changed files with 18 additions and 10 deletions

View File

@ -382,6 +382,14 @@ impl Bank {
pub fn last_blockhash(&self) -> Hash {
self.blockhash_queue.read().unwrap().last_hash()
}
/// Return the root bank's blockhash
pub fn get_confirmed_blockhash(&self) -> Hash {
if let Some(bank) = self.parents().last() {
bank.last_blockhash()
} else {
self.last_blockhash()
}
}
/// Forget all signatures. Useful for benchmarking.
pub fn clear_signatures(&self) {