mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
add batch_rbf option to Qt GUI
This commit is contained in:
parent
2b8d801b36
commit
f55db2f90b
2 changed files with 16 additions and 3 deletions
|
@ -2746,17 +2746,30 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
feebox_cb.stateChanged.connect(on_feebox)
|
feebox_cb.stateChanged.connect(on_feebox)
|
||||||
fee_widgets.append((feebox_cb, None))
|
fee_widgets.append((feebox_cb, None))
|
||||||
|
|
||||||
|
use_rbf = self.config.get('use_rbf', True)
|
||||||
use_rbf_cb = QCheckBox(_('Use Replace-By-Fee'))
|
use_rbf_cb = QCheckBox(_('Use Replace-By-Fee'))
|
||||||
use_rbf_cb.setChecked(self.config.get('use_rbf', True))
|
use_rbf_cb.setChecked(use_rbf)
|
||||||
use_rbf_cb.setToolTip(
|
use_rbf_cb.setToolTip(
|
||||||
_('If you check this box, your transactions will be marked as non-final,') + '\n' + \
|
_('If you check this box, your transactions will be marked as non-final,') + '\n' + \
|
||||||
_('and you will have the possibility, while they are unconfirmed, to replace them with transactions that pay higher fees.') + '\n' + \
|
_('and you will have the possibility, 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.'))
|
_('Note that some merchants do not accept non-final transactions until they are confirmed.'))
|
||||||
def on_use_rbf(x):
|
def on_use_rbf(x):
|
||||||
self.config.set_key('use_rbf', x == Qt.Checked)
|
self.config.set_key('use_rbf', bool(x))
|
||||||
|
batch_rbf_cb.setEnabled(bool(x))
|
||||||
use_rbf_cb.stateChanged.connect(on_use_rbf)
|
use_rbf_cb.stateChanged.connect(on_use_rbf)
|
||||||
fee_widgets.append((use_rbf_cb, None))
|
fee_widgets.append((use_rbf_cb, None))
|
||||||
|
|
||||||
|
batch_rbf_cb = QCheckBox(_('Batch RBF transactions'))
|
||||||
|
batch_rbf_cb.setChecked(self.config.get('batch_rbf', False))
|
||||||
|
batch_rbf_cb.setEnabled(use_rbf)
|
||||||
|
batch_rbf_cb.setToolTip(
|
||||||
|
_('If you check this box, your unconfirmed transactios will be consolidated in a single transaction') + '\n' + \
|
||||||
|
_('This will save fees.'))
|
||||||
|
def on_batch_rbf(x):
|
||||||
|
self.config.set_key('batch_rbf', bool(x))
|
||||||
|
batch_rbf_cb.stateChanged.connect(on_batch_rbf)
|
||||||
|
fee_widgets.append((batch_rbf_cb, None))
|
||||||
|
|
||||||
msg = _('OpenAlias record, used to receive coins and to sign payment requests.') + '\n\n'\
|
msg = _('OpenAlias record, used to receive coins and to sign payment requests.') + '\n\n'\
|
||||||
+ _('The following alias providers are available:') + '\n'\
|
+ _('The following alias providers are available:') + '\n'\
|
||||||
+ '\n'.join(['https://cryptoname.co/', 'http://xmr.link']) + '\n\n'\
|
+ '\n'.join(['https://cryptoname.co/', 'http://xmr.link']) + '\n\n'\
|
||||||
|
|
|
@ -593,7 +593,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
||||||
coin_chooser = coinchooser.get_coin_chooser(config)
|
coin_chooser = coinchooser.get_coin_chooser(config)
|
||||||
# If there is an unconfirmed RBF tx, merge with it
|
# If there is an unconfirmed RBF tx, merge with it
|
||||||
base_tx = self.get_unconfirmed_tx()
|
base_tx = self.get_unconfirmed_tx()
|
||||||
if base_tx and not base_tx.is_final():
|
if config.get('batch_rbf', False) and base_tx and not base_tx.is_final():
|
||||||
base_tx = Transaction(base_tx.serialize())
|
base_tx = Transaction(base_tx.serialize())
|
||||||
base_tx.deserialize(force_full_parse=True)
|
base_tx.deserialize(force_full_parse=True)
|
||||||
base_tx.remove_signatures()
|
base_tx.remove_signatures()
|
||||||
|
|
Loading…
Add table
Reference in a new issue