Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Fill in not-yet-finalized block-time if possible (#16460) (#16462)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8bc0bdd)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
  • Loading branch information
mergify[bot] and CriesofCarrots authored Apr 9, 2021
1 parent 11ab894 commit 127e740
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,12 +1214,18 @@ impl JsonRpcRequestProcessor {
self.blockstore.get_rooted_transaction(signature)
};
match transaction.unwrap_or(None) {
Some(confirmed_transaction) => {
Some(mut confirmed_transaction) => {
if commitment.is_confirmed()
&& confirmed_bank // should be redundant
.status_cache_ancestors()
.contains(&confirmed_transaction.slot)
{
if confirmed_transaction.block_time.is_none() {
let r_bank_forks = self.bank_forks.read().unwrap();
confirmed_transaction.block_time = r_bank_forks
.get(confirmed_transaction.slot)
.map(|bank| bank.clock().unix_timestamp);
}
return Ok(Some(confirmed_transaction.encode(encoding)));
}
if confirmed_transaction.slot
Expand Down

0 comments on commit 127e740

Please sign in to comment.