From af1625103ead217e9e64988b7c204d7ddad1f925 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Wed, 29 Jun 2022 15:18:31 +0900 Subject: [PATCH 1/2] protocols/gossipsub: Fix a typo in error message --- protocols/gossipsub/src/behaviour.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index ea8bd73b89a..eca31d161f0 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -1528,7 +1528,7 @@ where ) .is_err() { - error!("Failed to send graft. Message too large"); + error!("Failed to send PRUNE. Message too large"); } } debug!("Completed GRAFT handling for peer: {}", peer_id); From a055504444a46a99374b90a90674b673ea700c7b Mon Sep 17 00:00:00 2001 From: ackintosh Date: Wed, 29 Jun 2022 22:52:10 +0900 Subject: [PATCH 2/2] protocols/gossipsub: Make the error message accurately --- protocols/gossipsub/src/behaviour.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index eca31d161f0..92bef2fe4b6 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -1516,19 +1516,16 @@ where peer_id ); - if self - .send_message( - *peer_id, - GossipsubRpc { - subscriptions: Vec::new(), - messages: Vec::new(), - control_msgs: prune_messages, - } - .into_protobuf(), - ) - .is_err() - { - error!("Failed to send PRUNE. Message too large"); + if let Err(e) = self.send_message( + *peer_id, + GossipsubRpc { + subscriptions: Vec::new(), + messages: Vec::new(), + control_msgs: prune_messages, + } + .into_protobuf(), + ) { + error!("Failed to send PRUNE: {:?}", e); } } debug!("Completed GRAFT handling for peer: {}", peer_id);