URI: 
       tfix #3998 - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 4b7cf297f5cf9513b32fcce2c5773af2ab1c7492
   DIR parent 2a51914c31b8696b51198663f02e269517fb710f
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Fri,  2 Mar 2018 18:00:05 +0100
       
       fix #3998
       
       Diffstat:
         M lib/wallet.py                       |      15 +++++++++------
       
       1 file changed, 9 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -866,16 +866,19 @@ class Abstract_Wallet(PrintError):
                    return True
        
            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:
       -                    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, None)
       -            undo_spend(self.pruned_txo)
       -            undo_spend(self.spent_outpoints)
       +            # undo spent_outpoints that are in txi
       +            for addr, l in self.txi[tx_hash].items():
       +                for ser, v in l:
       +                    self.spent_outpoints.pop(ser, None)
       +            # undo spent_outpoints that are in pruned_txo
       +            for ser, hh in list(self.pruned_txo.items()):
       +                if hh == tx_hash:
       +                    self.spent_outpoints.pop(ser)
       +                    self.pruned_txo.pop(ser)
        
                    # add tx to pruned_txo, and undo the txi addition
                    for next_tx, dd in self.txi.items():