Apply PR feedback

This commit is contained in:
NIC619
2019-07-30 23:41:28 +08:00
parent 76de01a17d
commit 5e215901c0
8 changed files with 17 additions and 20 deletions

View File

@ -533,6 +533,7 @@ class GossipSub(IPubsubRouter):
from_id_str = sender_peer_id
# FIXME: Update type of message ID
# FIXME: Find a better way to parse the msg ids
msg_ids: List[Any] = [literal_eval(msg) for msg in iwant_msg.messageIDs]
msgs_to_forward: List[rpc_pb2.Message] = []
for msg_id_iwant in msg_ids:

View File

@ -373,6 +373,6 @@ class Pubsub:
self.seen_messages[msg_id] = 1
def _is_subscribed_to_msg(self, msg: rpc_pb2.Message) -> bool:
if not bool(self.my_topics):
if not self.my_topics:
return False
return all([topic in self.my_topics for topic in msg.topicIDs])