Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: call increment once #13193

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crates/transaction-pool/src/pool/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,16 @@ impl<T: TransactionOrdering> TxPool<T> {
self.all_transactions.set_block_info(block_info);

// Remove all transaction that were included in the block
let mut removed_txs_count = 0;
for tx_hash in &mined_transactions {
if self.prune_transaction_by_hash(tx_hash).is_some() {
// Update removed transactions metric
self.metrics.removed_transactions.increment(1);
removed_txs_count += 1;
}
}

// Update removed transactions metric
self.metrics.removed_transactions.increment(removed_txs_count);

let UpdateOutcome { promoted, discarded } = self.update_accounts(changed_senders);

self.update_transaction_type_metrics();
Expand Down
Loading