mirror of https://github.com/status-im/nim-eth.git
Merge pull request #137 from status-im/no-zero-send
Do not send empty messages packets at interval
This commit is contained in:
commit
9165ff8549
|
@ -270,10 +270,11 @@ proc processQueue(peer: Peer) =
|
||||||
envelopes.add(message.env)
|
envelopes.add(message.env)
|
||||||
wakuPeer.received.incl(message)
|
wakuPeer.received.incl(message)
|
||||||
|
|
||||||
trace "Sending envelopes", amount=envelopes.len
|
if envelopes.len() > 0:
|
||||||
# Ignore failure of sending messages, this could occur when the connection
|
trace "Sending envelopes", amount=envelopes.len
|
||||||
# gets dropped
|
# Ignore failure of sending messages, this could occur when the connection
|
||||||
traceAsyncErrors peer.messages(envelopes)
|
# gets dropped
|
||||||
|
traceAsyncErrors peer.messages(envelopes)
|
||||||
|
|
||||||
proc run(peer: Peer) {.async.} =
|
proc run(peer: Peer) {.async.} =
|
||||||
while peer.connectionState notin {Disconnecting, Disconnected}:
|
while peer.connectionState notin {Disconnecting, Disconnected}:
|
||||||
|
|
|
@ -265,10 +265,11 @@ proc processQueue(peer: Peer) =
|
||||||
envelopes.add(message.env)
|
envelopes.add(message.env)
|
||||||
whisperPeer.received.incl(message)
|
whisperPeer.received.incl(message)
|
||||||
|
|
||||||
trace "Sending envelopes", amount=envelopes.len
|
if envelopes.len() > 0:
|
||||||
# Ignore failure of sending messages, this could occur when the connection
|
trace "Sending envelopes", amount=envelopes.len
|
||||||
# gets dropped
|
# Ignore failure of sending messages, this could occur when the connection
|
||||||
traceAsyncErrors peer.messages(envelopes)
|
# gets dropped
|
||||||
|
traceAsyncErrors peer.messages(envelopes)
|
||||||
|
|
||||||
proc run(peer: Peer) {.async.} =
|
proc run(peer: Peer) {.async.} =
|
||||||
while peer.connectionState notin {Disconnecting, Disconnected}:
|
while peer.connectionState notin {Disconnecting, Disconnected}:
|
||||||
|
|
Loading…
Reference in New Issue