fix: use address and not key in db_addr
[electrum-server.git] / backends / bitcoind / storage.py
index cca9645..6dcf027 100644 (file)
@@ -144,8 +144,7 @@ class Storage(object):
 
 
     def get_address(self, txi):
-        addr = self.db_addr.get(txi)
-        return self.key_to_address(addr) if addr else None
+        return self.db_addr.get(txi)
 
 
     def get_undo_info(self, height):
@@ -492,7 +491,7 @@ class Storage(object):
         self.add_address(key + txo, value, tx_height)
 
         # backlink
-        self.db_addr.put(txo, key)
+        self.db_addr.put(txo, addr)
 
 
 
@@ -542,7 +541,7 @@ class Storage(object):
         leaf = key + txi
 
         # restore backlink
-        self.db_addr.put(txi, key)
+        self.db_addr.put(txi, addr)
 
         v, height = undo.pop(leaf)
         self.add_address(leaf, v, height)