Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
set entry in transaction_qos_cost_results to Err() if its tx failed t…
Browse files Browse the repository at this point in the history
…o get lock
  • Loading branch information
tao-stones committed Jan 24, 2024
1 parent 7d7efcc commit 7c3941c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/src/banking_stage/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,12 @@ impl Consumer {
.iter()
.zip(transaction_qos_cost_results.iter_mut())
.map(|(lock_result, cost)| {
if let Err(_lock_err) = lock_result {
if let Ok(tx_cost) = cost {
// reset cost to lock_err, so it won't be accidentally removed more than once
// TODO *cost = Err(lock_err.clone());
return Some(tx_cost);
if let Err(lock_err) = lock_result {
if cost.is_ok() {
// set cost to lock_err, so it won't be accidentally removed more than once
let mut c = Err(lock_err.clone());
std::mem::swap(cost, &mut c);
return Some(c.unwrap());
}
}
None
Expand Down

0 comments on commit 7c3941c

Please sign in to comment.