From fe405c50d0ea1670410ab8e9269055d21e81a653 Mon Sep 17 00:00:00 2001 From: ecdsa Date: Thu, 2 May 2013 09:54:43 +0200 Subject: [PATCH] delete_imported_key method --- gui/gui_classic.py | 3 +-- lib/wallet.py | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gui/gui_classic.py b/gui/gui_classic.py index b14b11e1f..fa25c8236 100644 --- a/gui/gui_classic.py +++ b/gui/gui_classic.py @@ -971,10 +971,9 @@ class ElectrumWindow(QMainWindow): def delete_imported_key(self, addr): if self.question(_("Do you want to remove")+" %s "%addr +_("from your wallet?")): - self.wallet.imported_keys.pop(addr) + self.wallet.delete_imported_key(addr) self.update_receive_tab() self.update_history_tab() - self.wallet.save() def create_receive_menu(self, position): diff --git a/lib/wallet.py b/lib/wallet.py index ddfb9cc22..4950b8d3d 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -147,6 +147,11 @@ class Wallet: self.config.set_key('imported_keys', self.imported_keys, True) return address + def delete_imported_key(self, addr): + if addr in self.imported_keys: + self.imported_keys.pop(addr) + self.config.set_key('imported_keys', self.imported_keys, True) + def init_seed(self, seed): if self.seed: raise BaseException("a seed exists") @@ -318,7 +323,7 @@ class Wallet: def change_gap_limit(self, value): if value >= self.gap_limit: self.gap_limit = value - self.save() + self.config.set_key('gap_limit', self.gap_limit, True) self.interface.poke('synchronizer') return True