Skip to content

Commit

Permalink
Replace RBF setting in Send tab and "Propose RBF" in prefs, with sing…
Browse files Browse the repository at this point in the history
…le "use rbf" checkbox in prefs.
  • Loading branch information
SomberNight committed Dec 20, 2017
1 parent 0c66634 commit a6bc7b1
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions gui/qt/main_window.py
Expand Up @@ -1110,13 +1110,6 @@ def setAmount(self, byte_size):

self.connect_fields(self, self.amount_e, self.fiat_send_e, self.fee_e)

#self.rbf_checkbox = QCheckBox(_('Replaceable'))
#msg = [_('If you check this box, your transaction will be marked as non-final,'),
# _('and you will have the possiblity, while it is unconfirmed, to replace it with a transaction that pays a higher fee.'),
# _('Note that some merchants do not accept non-final transactions until they are confirmed.')]
#self.rbf_checkbox.setToolTip('<p>' + ' '.join(msg) + '</p>')
#self.rbf_checkbox.setVisible(False)

vbox_feelabel = QVBoxLayout()
vbox_feelabel.addWidget(self.fee_e_label)
vbox_feelabel.addStretch(1)
Expand Down Expand Up @@ -1279,24 +1272,6 @@ def do_update_fee(self):
amount = tx.output_value()
self.amount_e.setAmount(amount)

if fee is None:
return
#rbf_policy = self.config.get('rbf_policy', 1)
#if rbf_policy == 0:
# b = True
#elif rbf_policy == 1:
# fee_rate = fee * 1000 / tx.estimated_size()
# try:
# c = self.config.reverse_dynfee(fee_rate)
# b = c in [-1, 25]
# except:
# b = False
#elif rbf_policy == 2:
# b = False
#self.rbf_checkbox.setVisible(b)
#self.rbf_checkbox.setChecked(b)


def from_list_delete(self, item):
i = self.from_list.indexOfTopLevelItem(item)
self.pay_from.pop(i)
Expand Down Expand Up @@ -1444,7 +1419,7 @@ def do_send(self, preview = False):
amount = tx.output_value() if self.is_max else sum(map(lambda x:x[2], outputs))
fee = tx.get_fee()

use_rbf = True#self.rbf_checkbox.isChecked()
use_rbf = self.config.get('use_rbf', True)
if use_rbf:
tx.set_rbf(True)

Expand Down Expand Up @@ -1657,7 +1632,6 @@ def do_clear(self):
e.setFrozen(False)
self.size_e.setAmount(0)
self.set_pay_from([])
#self.rbf_checkbox.setChecked(False)
self.tx_external_keypairs = {}
self.update_status()
run_hook('do_clear', self)
Expand Down Expand Up @@ -2597,15 +2571,16 @@ def on_feebox(x):
feebox_cb.stateChanged.connect(on_feebox)
fee_widgets.append((feebox_cb, None))

rbf_policy = self.config.get('rbf_policy', 1)
rbf_label = HelpLabel(_('Propose Replace-By-Fee') + ':', '')
rbf_combo = QComboBox()
rbf_combo.addItems([_('Always'), _('If the fee is low'), _('Never')])
rbf_combo.setCurrentIndex(rbf_policy)
def on_rbf(x):
self.config.set_key('rbf_policy', x)
rbf_combo.currentIndexChanged.connect(on_rbf)
fee_widgets.append((rbf_label, rbf_combo))
use_rbf_cb = QCheckBox(_('Use Replace-By-Fee'))
use_rbf_cb.setChecked(self.config.get('use_rbf', True))
use_rbf_cb.setToolTip(
_('If you check this box, your transactions will be marked as non-final,') + '\n' + \
_('and you will have the possiblity, while they are unconfirmed, to replace them with transactions that pay higher fees.') + '\n' + \
_('Note that some merchants do not accept non-final transactions until they are confirmed.'))
def on_use_rbf(x):
self.config.set_key('use_rbf', x == Qt.Checked)
use_rbf_cb.stateChanged.connect(on_use_rbf)
fee_widgets.append((use_rbf_cb, None))

self.fee_unit = self.config.get('fee_unit', 0)
fee_unit_label = HelpLabel(_('Fee Unit') + ':', '')
Expand Down

0 comments on commit a6bc7b1

Please sign in to comment.