twallet set_fee method - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 19d19d9a00795f8002d5f08344c994a1b16d5b81 DIR parent fe405c50d0ea1670410ab8e9269055d21e81a653 HTML Author: ecdsa <ecdsa@github> Date: Thu, 2 May 2013 10:00:52 +0200 wallet set_fee method Diffstat: M gui/gui_android.py | 8 +++----- M gui/gui_classic.py | 4 +--- M gui/gui_gtk.py | 4 +--- M lib/wallet.py | 6 ++++++ 4 files changed, 11 insertions(+), 11 deletions(-) --- DIR diff --git a/gui/gui_android.py b/gui/gui_android.py t@@ -825,11 +825,9 @@ def settings_loop(): fee = int( 100000000 * Decimal(fee) ) except: modal_dialog('error','invalid fee value') - if wallet.fee != fee: - wallet.fee = fee - wallet.save() - set_listview() - + wallet.set_fee(fee) + set_listview() + elif pos == "4": if change_password_dialog(): set_listview() DIR diff --git a/gui/gui_classic.py b/gui/gui_classic.py t@@ -2031,9 +2031,7 @@ class ElectrumWindow(QMainWindow): QMessageBox.warning(self, _('Error'), _('Invalid value') +': %s'%fee, _('OK')) return - if self.wallet.fee != fee: - self.wallet.fee = fee - self.wallet.save() + self.wallet.set_fee(fee) nz = unicode(nz_e.text()) try: DIR diff --git a/gui/gui_gtk.py b/gui/gui_gtk.py t@@ -249,9 +249,7 @@ def run_settings_dialog(wallet, parent): except: show_message("error") return - if wallet.fee != fee: - wallet.fee = fee - wallet.save() + wallet.set_fee(fee) try: nz = int( nz ) DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -873,6 +873,12 @@ class Wallet: else: return False + def set_fee(self, fee): + if self.fee != fee: + self.fee = fee + self.config.set_key('fee_per_kb', self.fee, True) + + def save(self): tx = {} for k,v in self.transactions.items():