From e5703833cf6da8394b9730a83504bc1dd14742cb Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 23 May 2018 17:33:22 -0400 Subject: [PATCH] prevent duplicate entries in the datastore --- lbrynet/dht/datastore.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbrynet/dht/datastore.py b/lbrynet/dht/datastore.py index 34304f29f..57cdac9ae 100644 --- a/lbrynet/dht/datastore.py +++ b/lbrynet/dht/datastore.py @@ -40,7 +40,8 @@ class DictDataStore(UserDict.DictMixin): def addPeerToBlob(self, key, value, lastPublished, originallyPublished, originalPublisherID): if key in self._dict: - self._dict[key].append((value, lastPublished, originallyPublished, originalPublisherID)) + if value not in map(lambda store_tuple: store_tuple[0], self._dict[key]): + self._dict[key].append((value, lastPublished, originallyPublished, originalPublisherID)) else: self._dict[key] = [(value, lastPublished, originallyPublished, originalPublisherID)]