perf(tx-pool): avoid copying tx cost (#12629)

This commit is contained in:
Hai | RISE
2024-11-20 16:56:12 +07:00
committed by GitHub
parent 11847b4f1e
commit 7b13a22698
6 changed files with 63 additions and 39 deletions

View File

@ -384,11 +384,12 @@ where
let cost = transaction.cost();
// Checks for max cost
if cost > account.balance {
if cost > &account.balance {
let expected = *cost;
return TransactionValidationOutcome::Invalid(
transaction,
InvalidTransactionError::InsufficientFunds(
GotExpected { got: account.balance, expected: cost }.into(),
GotExpected { got: account.balance, expected }.into(),
)
.into(),
)