Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 0e2391b

Browse files
committed
Fix bug in keep alive loop
1 parent a22568f commit 0e2391b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

dht/protocol.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import random
7-
87
from twisted.internet import reactor
98
from zope.interface import implements
109
import nacl.signing

net/wireprotocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ def set_servers(self, ws, blockchain):
203203
self.blockchain = blockchain
204204

205205
def keep_alive(self):
206-
for connection in self:
207-
if connection.state != State.CONNECTING:
206+
for connection in self.values():
207+
if connection.state == State.CONNECTED:
208208
connection.handler.keep_alive()
209209

210210
def send_message(self, datagram, address, relay_addr):

0 commit comments

Comments
 (0)