Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Commit

Permalink
fix: use address and not key in db_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasV committed Mar 1, 2014
1 parent b9d7445 commit 2a8c19f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backends/bitcoind/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ def get_history(self, addr):


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):
Expand Down Expand Up @@ -492,7 +491,7 @@ def add_to_history(self, addr, tx_hash, tx_pos, value, tx_height):
self.add_address(key + txo, value, tx_height)

# backlink
self.db_addr.put(txo, key)
self.db_addr.put(txo, addr)



Expand Down Expand Up @@ -542,7 +541,7 @@ def revert_set_spent(self, addr, txi, undo):
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)
Expand Down

0 comments on commit 2a8c19f

Please sign in to comment.