Skip to content

Commit

Permalink
on bootstrap_mode: do not reply to pings #36
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljim committed Jan 11, 2012
1 parent 012378b commit 12f1764
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/responder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@

class Responder(object):

def __init__(self, my_id, routing_m, msg_f):
def __init__(self, my_id, routing_m, msg_f,
bootstrap_mode=False):
self._my_id = my_id
self._routing_m = routing_m
self.msg_f = msg_f
self.bootstrap_mode = bootstrap_mode
self._tracker = tracker.Tracker()
self._token_m = token_manager.TokenManager()

def get_response(self, msg):
if msg.query == message.PING:
if self.bootstrap_mode:
return
return self.msg_f.outgoing_ping_response(msg.src_node)
elif msg.query == message.FIND_NODE:
log_distance = msg.target.log_distance(self._my_id)
Expand Down

0 comments on commit 12f1764

Please sign in to comment.