diff --git a/eth/p2p/rlpx_protocols/waku_protocol.nim b/eth/p2p/rlpx_protocols/waku_protocol.nim index 99c88c5..b8630be 100644 --- a/eth/p2p/rlpx_protocols/waku_protocol.nim +++ b/eth/p2p/rlpx_protocols/waku_protocol.nim @@ -270,10 +270,11 @@ proc processQueue(peer: Peer) = envelopes.add(message.env) wakuPeer.received.incl(message) - trace "Sending envelopes", amount=envelopes.len - # Ignore failure of sending messages, this could occur when the connection - # gets dropped - traceAsyncErrors peer.messages(envelopes) + if envelopes.len() > 0: + trace "Sending envelopes", amount=envelopes.len + # Ignore failure of sending messages, this could occur when the connection + # gets dropped + traceAsyncErrors peer.messages(envelopes) proc run(peer: Peer) {.async.} = while peer.connectionState notin {Disconnecting, Disconnected}: diff --git a/eth/p2p/rlpx_protocols/whisper_protocol.nim b/eth/p2p/rlpx_protocols/whisper_protocol.nim index d92919d..72026ef 100644 --- a/eth/p2p/rlpx_protocols/whisper_protocol.nim +++ b/eth/p2p/rlpx_protocols/whisper_protocol.nim @@ -265,10 +265,11 @@ proc processQueue(peer: Peer) = envelopes.add(message.env) whisperPeer.received.incl(message) - trace "Sending envelopes", amount=envelopes.len - # Ignore failure of sending messages, this could occur when the connection - # gets dropped - traceAsyncErrors peer.messages(envelopes) + if envelopes.len() > 0: + trace "Sending envelopes", amount=envelopes.len + # Ignore failure of sending messages, this could occur when the connection + # gets dropped + traceAsyncErrors peer.messages(envelopes) proc run(peer: Peer) {.async.} = while peer.connectionState notin {Disconnecting, Disconnected}: