Expose last-valid-slot to BankClient and ThinClient users (#10478)

automerge
This commit is contained in:
Greg Fitzgerald
2020-06-09 18:07:32 -06:00
committed by GitHub
parent b250e8c614
commit 4131eee94d
10 changed files with 52 additions and 34 deletions

View File

@ -55,7 +55,9 @@ type LibraKeys = (Keypair, Pubkey, Pubkey, Vec<Keypair>);
fn get_recent_blockhash<T: Client>(client: &T) -> (Hash, FeeCalculator) {
loop {
match client.get_recent_blockhash_with_commitment(CommitmentConfig::recent()) {
Ok((blockhash, fee_calculator)) => return (blockhash, fee_calculator),
Ok((blockhash, fee_calculator, _last_valid_slot)) => {
return (blockhash, fee_calculator)
}
Err(err) => {
info!("Couldn't get recent blockhash: {:?}", err);
sleep(Duration::from_secs(1));