mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-15 12:50:47 +02:00
Rename remote subscription attribute of peer class (#1422)
This commit is contained in:
parent
749ff87468
commit
be64e00b3d
4 changed files with 11 additions and 11 deletions
|
|
@ -245,7 +245,7 @@ class Connection(object):
|
|||
|
||||
def handle_subscribe(self, msg):
|
||||
self._send_reply_invs(msg.locator)
|
||||
self.peer.set_subscription(msg)
|
||||
self.peer.set_remote_subscription(msg)
|
||||
|
||||
def _send_reply_invs(self, locator):
|
||||
for interest in locator.vInterested:
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class Peer(object):
|
|||
self._num_msgs_sent = 0
|
||||
self._num_bytes_sent = 0
|
||||
|
||||
self._subscription = None
|
||||
self._remote_subscription = None
|
||||
|
||||
self.msg_receiver = MessageReceiver(
|
||||
self._peer_socket,
|
||||
|
|
@ -105,8 +105,8 @@ class Peer(object):
|
|||
return self._remote_address
|
||||
|
||||
@property
|
||||
def subscription(self):
|
||||
return self._subscription
|
||||
def remote_subscription(self):
|
||||
return self._remote_subscription
|
||||
|
||||
@property
|
||||
def local_caddress(self):
|
||||
|
|
@ -266,13 +266,13 @@ class Peer(object):
|
|||
def set_disconnected(self):
|
||||
self._connect_time = None
|
||||
|
||||
def set_subscription(self, subscription):
|
||||
self._subscription = subscription
|
||||
def set_remote_subscription(self, subscription):
|
||||
self._remote_subscription = subscription
|
||||
|
||||
def is_subscribed(self, squeak: CSqueak):
|
||||
if self.subscription is None:
|
||||
def is_remote_subscribed(self, squeak: CSqueak):
|
||||
if self.remote_subscription is None:
|
||||
return False
|
||||
locator = self.subscription.locator
|
||||
locator = self.remote_subscription.locator
|
||||
for interest in locator.vInterested:
|
||||
if squeak_matches_interest(squeak, interest):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class UpdateSubscribedSecretKeysWorker:
|
|||
get_hash(squeak).hex(),
|
||||
))
|
||||
for peer in self.network_manager.get_connected_peers():
|
||||
if peer.is_subscribed(squeak):
|
||||
if peer.is_remote_subscribed(squeak):
|
||||
logger.debug("Forwarding to peer: {}".format(
|
||||
peer,
|
||||
))
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class UpdateSubscribedSqueaksWorker:
|
|||
get_hash(squeak).hex(),
|
||||
))
|
||||
for peer in self.network_manager.get_connected_peers():
|
||||
if peer.is_subscribed(squeak):
|
||||
if peer.is_remote_subscribed(squeak):
|
||||
logger.debug("Forwarding to peer: {}".format(
|
||||
peer,
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue