Refactor: check_transactions - allow borrowed transactions (#34232)
This commit is contained in:
parent
656ec4bdf0
commit
40f5870a47
|
@ -4519,7 +4519,7 @@ impl Bank {
|
|||
|
||||
fn check_age<'a>(
|
||||
&self,
|
||||
txs: impl Iterator<Item = &'a SanitizedTransaction>,
|
||||
txs: impl Iterator<Item = &'a (impl core::borrow::Borrow<SanitizedTransaction> + 'a)>,
|
||||
lock_results: &[Result<()>],
|
||||
max_age: usize,
|
||||
error_counters: &mut TransactionErrorMetrics,
|
||||
|
@ -4531,7 +4531,7 @@ impl Bank {
|
|||
txs.zip(lock_results)
|
||||
.map(|(tx, lock_res)| match lock_res {
|
||||
Ok(()) => self.check_transaction_age(
|
||||
tx,
|
||||
tx.borrow(),
|
||||
max_age,
|
||||
&next_durable_nonce,
|
||||
&hash_queue,
|
||||
|
@ -4577,7 +4577,7 @@ impl Bank {
|
|||
|
||||
fn check_status_cache(
|
||||
&self,
|
||||
sanitized_txs: &[SanitizedTransaction],
|
||||
sanitized_txs: &[impl core::borrow::Borrow<SanitizedTransaction>],
|
||||
lock_results: Vec<TransactionCheckResult>,
|
||||
error_counters: &mut TransactionErrorMetrics,
|
||||
) -> Vec<TransactionCheckResult> {
|
||||
|
@ -4586,6 +4586,7 @@ impl Bank {
|
|||
.iter()
|
||||
.zip(lock_results)
|
||||
.map(|(sanitized_tx, (lock_result, nonce))| {
|
||||
let sanitized_tx = sanitized_tx.borrow();
|
||||
if lock_result.is_ok()
|
||||
&& self.is_transaction_already_processed(sanitized_tx, &rcache)
|
||||
{
|
||||
|
@ -4640,7 +4641,7 @@ impl Bank {
|
|||
|
||||
pub fn check_transactions(
|
||||
&self,
|
||||
sanitized_txs: &[SanitizedTransaction],
|
||||
sanitized_txs: &[impl core::borrow::Borrow<SanitizedTransaction>],
|
||||
lock_results: &[Result<()>],
|
||||
max_age: usize,
|
||||
error_counters: &mut TransactionErrorMetrics,
|
||||
|
|
Loading…
Reference in New Issue