mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(net): add reported bad transactions metric (#2270)
This commit is contained in:
@ -40,6 +40,8 @@ pub struct NetworkMetrics {
|
||||
pub struct TransactionsManagerMetrics {
|
||||
/// Total number of propagated transactions
|
||||
pub(crate) propagated_transactions: Counter,
|
||||
/// Total number of reported bad transactions
|
||||
pub(crate) reported_bad_transactions: Counter,
|
||||
}
|
||||
|
||||
/// Metrics for Disconnection types
|
||||
|
||||
@ -534,6 +534,7 @@ where
|
||||
if err.is_bad_transaction() && !this.network.is_syncing() {
|
||||
trace!(target: "net::tx", ?err, "Bad transaction import");
|
||||
this.on_bad_import(*err.hash());
|
||||
this.metrics.reported_bad_transactions.increment(1);
|
||||
continue
|
||||
}
|
||||
this.on_good_import(*err.hash());
|
||||
|
||||
Reference in New Issue
Block a user