mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-10 07:48:19 -05:00
chore: update metric once (#20371)
This commit is contained in:
@@ -936,6 +936,7 @@ impl<T: TransactionOrdering> TxPool<T> {
|
||||
/// This will move/discard the given transaction according to the `PoolUpdate`
|
||||
fn process_updates(&mut self, updates: Vec<PoolUpdate>) -> UpdateOutcome<T::Transaction> {
|
||||
let mut outcome = UpdateOutcome::default();
|
||||
let mut removed = 0;
|
||||
for PoolUpdate { id, current, destination } in updates {
|
||||
match destination {
|
||||
Destination::Discard => {
|
||||
@@ -943,7 +944,7 @@ impl<T: TransactionOrdering> TxPool<T> {
|
||||
if let Some(tx) = self.prune_transaction_by_id(&id) {
|
||||
outcome.discarded.push(tx);
|
||||
}
|
||||
self.metrics.removed_transactions.increment(1);
|
||||
removed += 1;
|
||||
}
|
||||
Destination::Pool(move_to) => {
|
||||
debug_assert_ne!(&move_to, ¤t, "destination must be different");
|
||||
@@ -958,6 +959,10 @@ impl<T: TransactionOrdering> TxPool<T> {
|
||||
}
|
||||
}
|
||||
|
||||
if removed > 0 {
|
||||
self.metrics.removed_transactions.increment(removed);
|
||||
}
|
||||
|
||||
outcome
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user