Browse Source

Merge pull request #1257 from kyuupichan/update_fee

Fix calls to update_fee
283
ThomasV 10 years ago
parent
commit
3195b94f28
  1. 12
      gui/qt/main_window.py
  2. 2
      gui/qt/paytoedit.py
  3. 7
      lib/wallet.py

12
gui/qt/main_window.py

@ -1445,6 +1445,7 @@ class ElectrumWindow(QMainWindow):
def send_from_addresses(self, addrs): def send_from_addresses(self, addrs):
self.set_pay_from( addrs ) self.set_pay_from( addrs )
self.tabs.setCurrentIndex(1) self.tabs.setCurrentIndex(1)
self.update_fee(False)
def paytomany(self): def paytomany(self):
self.tabs.setCurrentIndex(1) self.tabs.setCurrentIndex(1)
@ -2527,10 +2528,13 @@ class ElectrumWindow(QMainWindow):
fee_e.setAmount(self.wallet.fee_per_kb) fee_e.setAmount(self.wallet.fee_per_kb)
if not self.config.is_modifiable('fee_per_kb'): if not self.config.is_modifiable('fee_per_kb'):
for w in [fee_e, fee_label]: w.setEnabled(False) for w in [fee_e, fee_label]: w.setEnabled(False)
def on_fee(): def on_fee(is_done):
fee = fee_e.get_amount() self.wallet.set_fee(fee_e.get_amount(), is_done)
self.wallet.set_fee(fee) if not is_done:
fee_e.editingFinished.connect(on_fee) self.update_fee(False)
fee_e.editingFinished.connect(lambda: on_fee(True))
fee_e.textEdited.connect(lambda: on_fee(False))
widgets.append((fee_label, fee_e, fee_help)) widgets.append((fee_label, fee_e, fee_help))
units = ['BTC', 'mBTC', 'bits'] units = ['BTC', 'mBTC', 'bits']

2
gui/qt/paytoedit.py

@ -135,8 +135,6 @@ class PayToEdit(ScanQRTextEdit):
else: else:
self.amount_edit.setText("") self.amount_edit.setText("")
self.amount_edit.textEdited.emit("")
if total or len(lines)>1: if total or len(lines)>1:
self.lock_amount() self.lock_amount()
else: else:

7
lib/wallet.py

@ -634,10 +634,9 @@ class Abstract_Wallet(object):
xx += x xx += x
return cc, uu, xx return cc, uu, xx
def set_fee(self, fee): def set_fee(self, fee, save = True):
if self.fee_per_kb != fee: self.fee_per_kb = fee
self.fee_per_kb = fee self.storage.put('fee_per_kb', self.fee_per_kb, save)
self.storage.put('fee_per_kb', self.fee_per_kb, True)
def get_address_history(self, address): def get_address_history(self, address):
with self.lock: with self.lock:

Loading…
Cancel
Save