Skip to content

Commit

Permalink
Unlock only if lock_result was Ok (solana-labs#34652)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Jan 9, 2024
1 parent 74fde2d commit 95f888a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions accounts-db/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,18 +636,8 @@ impl Accounts {
) {
let keys: Vec<_> = txs
.zip(results)
.filter_map(|(tx, res)| match res {
Err(TransactionError::AccountLoadedTwice)
| Err(TransactionError::AccountInUse)
| Err(TransactionError::SanitizeFailure)
| Err(TransactionError::TooManyAccountLocks)
| Err(TransactionError::WouldExceedMaxBlockCostLimit)
| Err(TransactionError::WouldExceedMaxVoteCostLimit)
| Err(TransactionError::WouldExceedMaxAccountCostLimit)
| Err(TransactionError::WouldExceedAccountDataBlockLimit)
| Err(TransactionError::WouldExceedAccountDataTotalLimit) => None,
_ => Some(tx.get_account_locks_unchecked()),
})
.filter(|(_, res)| res.is_ok())
.map(|(tx, _)| tx.get_account_locks_unchecked())
.collect();
let mut account_locks = self.account_locks.lock().unwrap();
debug!("bank unlock accounts");
Expand Down

0 comments on commit 95f888a

Please sign in to comment.