From feaa393c5ff1201a67c2fb54bf04b9c0922e2c98 Mon Sep 17 00:00:00 2001 From: Stuckinaboot Date: Wed, 3 Apr 2019 00:34:39 -0400 Subject: [PATCH] Fix seen messages bug --- libp2p/pubsub/pubsub.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libp2p/pubsub/pubsub.py b/libp2p/pubsub/pubsub.py index aec04de..40c4036 100644 --- a/libp2p/pubsub/pubsub.py +++ b/libp2p/pubsub/pubsub.py @@ -86,9 +86,10 @@ class Pubsub(): if rpc_incoming.publish: # deal with RPC.publish for message in rpc_incoming.publish: - if message.seqno not in self.seen_messages: + id_in_seen_msgs = (message.seqno, message.from_id) + if id_in_seen_msgs not in self.seen_messages: should_publish = True - self.seen_messages.append((message.seqno, message.from_id)) + self.seen_messages.append(id_in_seen_msgs) await self.handle_talk(message) if rpc_incoming.subscriptions: