Skip to content

Commit 61c22c5

Browse files
committed
Clarify the error message when we disconnect a peer
We very regularly receive confusion over the super generic "Peer sent invalid data or we decided to disconnect due to a protocol error" message, which doesn't say very much. Usually, we end up disconnecting because we have a duplicate connection with a peer, which doesn't merit such a scary message. Instead, here we clarify the error message to just refer to the fact that we're disconnecting, and note that its usually a dup connection in a parenthetical.
1 parent 9d5adfc commit 61c22c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
10561056
match self.do_read_event(peer_descriptor, data) {
10571057
Ok(res) => Ok(res),
10581058
Err(e) => {
1059-
log_trace!(self.logger, "Peer sent invalid data or we decided to disconnect due to a protocol error");
1059+
log_trace!(self.logger, "Disconnecting peer due to a protocol error (usually a duplicate connection).");
10601060
self.disconnect_event_internal(peer_descriptor);
10611061
Err(e)
10621062
}

0 commit comments

Comments
 (0)