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

(cherry picked from commit c64d4f7693)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-01-20 22:16:20 +00:00
committed by GitHub
parent ad89be3c85
commit 6ae51ec5c3

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 };