estimate the total inbound bandwidth of IDONTWANT messages in bytes (#6438)

* estimate the total inbound bandwidth of IDONTWANT messages
This commit is contained in:
João Oliveira
2024-10-01 03:13:51 +01:00
committed by GitHub
parent 82098e1ef7
commit 4a62b2418c
2 changed files with 21 additions and 0 deletions

View File

@@ -3348,6 +3348,8 @@ where
};
if let Some(metrics) = self.metrics.as_mut() {
metrics.register_idontwant(message_ids.len());
let idontwant_size = message_ids.iter().map(|id| id.0.len()).sum();
metrics.register_idontwant_bytes(idontwant_size);
}
for message_id in message_ids {
peer.dont_send.insert(message_id, Instant::now());