catch exceptions in script_GetOP
[electrum-server.git] / backends / abe / __init__.py
index 13186fa..31d6242 100644 (file)
@@ -290,7 +290,7 @@ class AbeStore(DataStore.DataStore):
                 "index": int(pos),
                 "value": int(value),
             })
-            known_tx.append(self.hashout_hex(tx_hash))
+            known_tx.append(tx_hash)
 
         # todo: sort them really...
         txpoints = sorted(txpoints, key=operator.itemgetter("timestamp"))
@@ -517,8 +517,8 @@ class AbeStore(DataStore.DataStore):
         # find subset.
         # TODO: do not compute this on client request, better store the hash tree of each block in a database...
 
-        merkle = map(decode, merkle)
-        target_hash = decode(tx_hash)
+        merkle = map(hash_decode, merkle)
+        target_hash = hash_decode(tx_hash)
 
         s = []
         while len(merkle) != 1:
@@ -528,10 +528,10 @@ class AbeStore(DataStore.DataStore):
             while merkle:
                 new_hash = Hash(merkle[0] + merkle[1])
                 if merkle[0] == target_hash:
-                    s.append(encode(merkle[1]))
+                    s.append(hash_encode(merkle[1]))
                     target_hash = new_hash
                 elif merkle[1] == target_hash:
-                    s.append(encode(merkle[0]))
+                    s.append(hash_encode(merkle[0]))
                     target_hash = new_hash
                 n.append(new_hash)
                 merkle = merkle[2:]