Skip to content

Commit 6b74fc8

Browse files
committed
fix queue len check
1 parent bf0b266 commit 6b74fc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

protocols/gossipsub/src/queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<T: Ord> Queue<T> {
6868
/// Try to add an item to the Queue, return Err if the queue is full.
6969
pub(crate) fn try_push(&mut self, item: T) -> Result<(), T> {
7070
let mut shared = self.shared.lock().expect("lock to not be poisoned");
71-
if self.capacity >= shared.queue.len() {
71+
if shared.queue.len() >= self.capacity {
7272
return Err(item);
7373
}
7474
shared.queue.push(item);

0 commit comments

Comments
 (0)