fix: cache was using a wrong format
authorThomasV <thomasv@gitorious>
Sat, 24 Nov 2012 20:30:18 +0000 (00:30 +0400)
committerThomasV <thomasv@gitorious>
Sat, 24 Nov 2012 20:30:18 +0000 (00:30 +0400)
backends/abe/__init__.py

index 8e143aa..cade991 100644 (file)
@@ -394,18 +394,19 @@ class AbeStore(Datastore_class):
 
             txpoint.pop('tx_id')
 
+
+        txpoints = map(lambda x: {'tx_hash':x['tx_hash'], 'height':x['height']}, txpoints)
+        out = []
+        for item in txpoints:
+            if item not in out: out.append(item)
+
         # cache result
-        # do not cache mempool results because statuses are ambiguous
-        if not address_has_mempool:
-            with self.cache_lock:
-                self.tx_cache[addr] = txpoints
+        ## do not cache mempool results because statuses are ambiguous
+        #if not address_has_mempool:
+        with self.cache_lock:
+            self.tx_cache[addr] = out
         
-
-        out = map(lambda x: {'tx_hash':x['tx_hash'], 'height':x['height']}, txpoints)
-        out2 = []
-        for item in out:
-            if item not in out2: out2.append(item)
-        return out2
+        return out
 
 
     def get_status(self, addr, cache_only=False):