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
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyera Eulberg committed Apr 9, 2021
1 parent 22a18a6 commit 8e12e70
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 @@ -1190,12 +1190,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 8e12e70

Please sign in to comment.