Default to highest finalized block if no slot provided (#14701) (#14704)

(cherry picked from commit c64d4f7693)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-01-20 22:48:32 +00:00
committed by GitHub
parent d72c90e475
commit 8e38f90e54

View File

@ -880,7 +880,7 @@ pub fn process_get_block(
let slot = if let Some(slot) = slot {
slot
} else {
rpc_client.get_slot()?
rpc_client.get_slot_with_commitment(CommitmentConfig::max())?
};
let mut block =
@ -958,7 +958,7 @@ pub fn process_get_block_time(
let slot = if let Some(slot) = slot {
slot
} else {
rpc_client.get_slot()?
rpc_client.get_slot_with_commitment(CommitmentConfig::max())?
};
let timestamp = rpc_client.get_block_time(slot)?;
let block_time = CliBlockTime { slot, timestamp };