obey the rpcAttempts constant on retries

This commit is contained in:
Victor Shyba 2018-10-08 16:51:30 -03:00
parent 7e3512cbf2
commit db898307b5

View file

@ -120,7 +120,7 @@ class KademliaProtocol(protocol.DatagramProtocol):
@defer.inlineCallbacks
def sendRPC(self, contact, method, args):
while True:
for _ in range(constants.rpcAttempts):
try:
response = yield self._sendRPC(contact, method, args)
return response