Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Appease clippy
  • Loading branch information
AgeManning committed Dec 6, 2023
commit 6a1e07c2b3baa3c0da0e446721a3e12f5048369c
13 changes: 8 additions & 5 deletions protocols/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,11 +1376,14 @@ where
.get_mut(peer_id)
.expect("Peerid should exist");

if let Err(_) = sender.forward(
msg,
self.config.forward_queue_duration(),
self.metrics.as_mut(),
) {
if sender
.forward(
msg,
self.config.forward_queue_duration(),
self.metrics.as_mut(),
)
.is_err()
{
// Downscore the peer
if let Some((peer_score, ..)) = &mut self.peer_score {
peer_score.failed_message_slow_peer(peer_id);
Expand Down
4 changes: 0 additions & 4 deletions protocols/gossipsub/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ impl RpcSender {

/// Send a `RpcOut::IHave` message to the `RpcReceiver`
/// this is low priority and if queue is full the message is dropped.
#[must_use]
pub(crate) fn ihave(&mut self, ihave: IHave) -> Result<(), ()> {
self.non_priority
.try_send(RpcOut::IHave(ihave))
Expand All @@ -643,7 +642,6 @@ impl RpcSender {

/// Send a `RpcOut::IHave` message to the `RpcReceiver`
/// this is low priority and if queue is full the message is dropped.
#[must_use]
pub(crate) fn iwant(&mut self, iwant: IWant) -> Result<(), ()> {
self.non_priority
.try_send(RpcOut::IWant(iwant))
Expand All @@ -668,7 +666,6 @@ impl RpcSender {

/// Send a `RpcOut::Publish` message to the `RpcReceiver`
/// this is high priority. If message sending fails, an `Err` is returned.
#[must_use]
pub(crate) fn publish(
&mut self,
message: RawMessage,
Expand All @@ -695,7 +692,6 @@ impl RpcSender {

/// Send a `RpcOut::Forward` message to the `RpcReceiver`
/// this is high priority. If the queue is full the message is discarded.
#[must_use]
pub(crate) fn forward(
&mut self,
message: RawMessage,
Expand Down