Skip to content

Commit

Permalink
Add must_use
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Jul 26, 2023
1 parent 1b4f846 commit 875057e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/new_index/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ impl Mempool {
}
};
// Add new transactions
self.add(to_add);
if to_add.len() > self.add(to_add) {
debug!("Mempool update added less transactions than expected");
}
// Remove missing transactions
self.remove(to_remove);

Expand Down Expand Up @@ -382,6 +384,7 @@ impl Mempool {
/// Add transactions to the mempool.
///
/// The return value is the number of transactions processed.
#[must_use = "Must deal with [[input vec's length]] > [[result]]."]
fn add(&mut self, txs: Vec<Transaction>) -> usize {
self.delta
.with_label_values(&["add"])
Expand Down

0 comments on commit 875057e

Please sign in to comment.