Use last_valid_block_height in services and client apps (#19163)

* Add deprecated tag to Bank::get_blockhash_last_valid_slot

* Update SendTransactionService to use last_valid_block_height

* Update solana-tokens to use last_valid_block_height

* Remove dangling file

* Update solana program to use last_valid_block_height

* Update Banks crates to use last_valid_block_height
This commit is contained in:
Tyera Eulberg
2021-08-11 01:04:00 -06:00
committed by GitHub
parent c4f2e5f88c
commit 5970083b4d
14 changed files with 190 additions and 128 deletions

View File

@ -2692,7 +2692,10 @@ impl Bank {
&self.fee_rate_governor
}
// DEPRECATED
#[deprecated(
since = "1.6.11",
note = "Please use `get_blockhash_last_valid_block_height`"
)]
pub fn get_blockhash_last_valid_slot(&self, blockhash: &Hash) -> Option<Slot> {
let blockhash_queue = self.blockhash_queue.read().unwrap();
// This calculation will need to be updated to consider epoch boundaries if BlockhashQueue

View File

@ -156,6 +156,7 @@ impl SyncClient for BankClient {
_commitment_config: CommitmentConfig,
) -> Result<(Hash, FeeCalculator, u64)> {
let (blockhash, fee_calculator) = self.bank.last_blockhash_with_fee_calculator();
#[allow(deprecated)]
let last_valid_slot = self
.bank
.get_blockhash_last_valid_slot(&blockhash)