We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf0b266 commit 6b74fc8Copy full SHA for 6b74fc8
protocols/gossipsub/src/queue.rs
@@ -68,7 +68,7 @@ impl<T: Ord> Queue<T> {
68
/// Try to add an item to the Queue, return Err if the queue is full.
69
pub(crate) fn try_push(&mut self, item: T) -> Result<(), T> {
70
let mut shared = self.shared.lock().expect("lock to not be poisoned");
71
- if self.capacity >= shared.queue.len() {
+ if shared.queue.len() >= self.capacity {
72
return Err(item);
73
}
74
shared.queue.push(item);
0 commit comments