Browse Source

dynfees: set default

283
ThomasV 8 years ago
parent
commit
8423f8394f
  1. 4
      gui/qt/main_window.py
  2. 2
      lib/wallet.py

4
gui/qt/main_window.py

@ -2285,7 +2285,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
fee_label = HelpLabel(_('Transaction fee per kb') + ':', msg) fee_label = HelpLabel(_('Transaction fee per kb') + ':', msg)
fee_e = BTCkBEdit(self.get_decimal_point) fee_e = BTCkBEdit(self.get_decimal_point)
def on_fee(is_done): def on_fee(is_done):
if self.config.get('dynamic_fees'): if self.config.get('dynamic_fees', True):
return return
v = fee_e.get_amount() or 0 v = fee_e.get_amount() or 0
self.config.set_key('fee_per_kb', v, is_done) self.config.set_key('fee_per_kb', v, is_done)
@ -2300,7 +2300,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
fee_widgets.append((dynfee_cb, None)) fee_widgets.append((dynfee_cb, None))
def update_feeperkb(): def update_feeperkb():
fee_e.setAmount(self.config.get('fee_per_kb', bitcoin.RECOMMENDED_FEE)) fee_e.setAmount(self.config.get('fee_per_kb', bitcoin.RECOMMENDED_FEE))
b = self.config.get('dynamic_fees', False) b = self.config.get('dynamic_fees', True)
fee_e.setEnabled(not b) fee_e.setEnabled(not b)
def on_dynfee(x): def on_dynfee(x):
self.config.set_key('dynamic_fees', x == Qt.Checked) self.config.set_key('dynamic_fees', x == Qt.Checked)

2
lib/wallet.py

@ -748,7 +748,7 @@ class Abstract_Wallet(PrintError):
return '' return ''
def fee_per_kb(self, config): def fee_per_kb(self, config):
b = config.get('dynamic_fees') b = config.get('dynamic_fees', True)
i = config.get('fee_level', 2) i = config.get('fee_level', 2)
if b and self.network and self.network.dynfee(i): if b and self.network and self.network.dynfee(i):
return self.network.dynfee(i) return self.network.dynfee(i)

Loading…
Cancel
Save