Query BigTable for block time if does not exist in blockstore (#12560)

This commit is contained in:
Tyera Eulberg 2020-09-29 15:39:36 -06:00 committed by GitHub
parent 74fcb184b2
commit 96a7d4dbd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -711,6 +711,15 @@ impl JsonRpcRequestProcessor {
.highest_confirmed_root()
{
let result = self.blockstore.get_block_time(slot);
if result.is_err() {
if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage {
return Ok(self
.runtime_handle
.block_on(bigtable_ledger_storage.get_confirmed_block(slot))
.ok()
.and_then(|confirmed_block| confirmed_block.block_time));
}
}
self.check_slot_cleaned_up(&result, slot)?;
Ok(result.ok().unwrap_or(None))
} else {