electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 19d19d9a00795f8002d5f08344c994a1b16d5b81
parent fe405c50d0ea1670410ab8e9269055d21e81a653
Author: ecdsa <ecdsa@github>
Date:   Thu,  2 May 2013 10:00:52 +0200

wallet set_fee method

Diffstat:
Mgui/gui_android.py | 8+++-----
Mgui/gui_classic.py | 4+---
Mgui/gui_gtk.py | 4+---
Mlib/wallet.py | 6++++++
4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/gui/gui_android.py b/gui/gui_android.py @@ -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() diff --git a/gui/gui_classic.py b/gui/gui_classic.py @@ -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: diff --git a/gui/gui_gtk.py b/gui/gui_gtk.py @@ -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 ) diff --git a/lib/wallet.py b/lib/wallet.py @@ -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():