Skip to content

Commit

Permalink
follow-up 586074c
Browse files Browse the repository at this point in the history
  • Loading branch information
SomberNight committed Feb 17, 2018
1 parent 586074c commit 0d758a6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/wallet.py
Expand Up @@ -278,8 +278,8 @@ def clear_history(self):
@profiler
def build_spent_outpoints(self):
self.spent_outpoints = {}
for txid in self.txi:
for addr, l in self.txi[txid].items():
for txid, items in self.txi.items():
for addr, l in items.items():
for ser, v in l:
self.spent_outpoints[ser] = txid

Expand Down Expand Up @@ -711,8 +711,8 @@ def get_txin_address(self, txi):
addr = txi.get('address')
if addr != "(pubkey)":
return addr
prevout_hash = x.get('prevout_hash')
prevout_n = x.get('prevout_n')
prevout_hash = txi.get('prevout_hash')
prevout_n = txi.get('prevout_n')
dd = self.txo.get(prevout_hash, {})
for addr, l in dd.items():
for n, v, is_cb in l:
Expand Down Expand Up @@ -837,12 +837,11 @@ def remove_transaction(self, tx_hash):
def undo_spend(outpoint_to_txid_map):
for addr, l in self.txi[tx_hash].items():
for ser, v in l:
if ser in outpoint_to_txid:
outpoint_to_txid_map.pop(ser)
outpoint_to_txid_map.pop(ser, None)

with self.transaction_lock:
self.print_error("removing tx from history", tx_hash)
self.transactions.pop(tx_hash)
self.transactions.pop(tx_hash, None)
undo_spend(self.pruned_txo)
undo_spend(self.spent_outpoints)

Expand Down

0 comments on commit 0d758a6

Please sign in to comment.