2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-05 21:20:51 +00:00

server running continuously now. true p2p!

This commit is contained in:
quadrismegistus 2020-08-19 15:13:58 +01:00
parent 27bb44767c
commit 7ea1fdf034
2 changed files with 4 additions and 4 deletions

View File

@ -88,7 +88,7 @@ class Api(object):
# self.root.ids.btn1.trigger_action() # self.root.ids.btn1.trigger_action()
i += 1 i += 1
await asyncio.sleep(2) await asyncio.sleep(10)
except asyncio.CancelledError as e: except asyncio.CancelledError as e:
self.log('Wasting time was canceled', e) self.log('Wasting time was canceled', e)
finally: finally:

View File

@ -7,8 +7,8 @@ from itertools import chain
from collections import OrderedDict from collections import OrderedDict
from kademlia.utils import shared_prefix, bytes_to_bit_string from kademlia.utils import shared_prefix, bytes_to_bit_string
EXCLUDE_PORTS = {5637} # EXCLUDE_PORTS = {5637}
# EXCLUDE_PORTS = {} EXCLUDE_PORTS = {}
class KBucket: class KBucket:
def __init__(self, rangeLower, rangeUpper, ksize, replacementNodeFactor=5): def __init__(self, rangeLower, rangeUpper, ksize, replacementNodeFactor=5):
@ -190,7 +190,7 @@ class RoutingTable:
for neighbor in TableTraverser(self, node): for neighbor in TableTraverser(self, node):
notexcluded = exclude is None or not neighbor.same_home_as(exclude) notexcluded = exclude is None or not neighbor.same_home_as(exclude)
notexcluded_port = exclude_ports is None or neighbor.port not in exclude_ports notexcluded_port = exclude_ports is None or neighbor.port not in exclude_ports
print('EXCLUDING_PORTS',notexcluded_port,exclude_ports) #print('EXCLUDING_PORTS',notexcluded_port,exclude_ports)
if neighbor.id != node.id and notexcluded: if neighbor.id != node.id and notexcluded:
heapq.heappush(nodes, (node.distance_to(neighbor), neighbor)) heapq.heappush(nodes, (node.distance_to(neighbor), neighbor))
if len(nodes) == k: if len(nodes) == k: