Browse Source

make rbf selection allowed configurable

patch-4
Sander van Grieken 3 years ago
parent
commit
cbd4d2a2ae
  1. 1
      electrum/gui/qml/components/ConfirmTxDialog.qml
  2. 1
      electrum/gui/qml/components/Send.qml
  3. 3
      electrum/gui/qml/qechannelopener.py
  4. 14
      electrum/gui/qml/qetxfinalizer.py

1
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -179,6 +179,7 @@ Dialog {
text: qsTr('Replace-by-Fee')
Layout.columnSpan: 2
checked: finalizer.rbf
visible: finalizer.canRbf
}
Rectangle {

1
electrum/gui/qml/components/Send.qml

@ -245,6 +245,7 @@ Pane {
title: qsTr('Confirm Payment')
finalizer: TxFinalizer {
wallet: Daemon.currentWallet
canRbf: True
}
}
}

3
electrum/gui/qml/qechannelopener.py

@ -140,11 +140,13 @@ class QEChannelOpener(QObject):
acpt = lambda tx: self.do_open_channel(tx, str(self._peer), None)
self._finalizer = QETxFinalizer(self, make_tx=mktx, accept=acpt)
self._finalizer.canRbf = False
self._finalizer.amount = self._amount
self._finalizer.wallet = self._wallet
self.finalizerChanged.emit()
def do_open_channel(self, funding_tx, conn_str, password):
self._logger.debug('opening channel')
# read funding_sat from tx; converts '!' to int value
funding_sat = funding_tx.output_value_for_address(ln_dummy_address())
lnworker = self._wallet.wallet.lnworker
@ -160,6 +162,7 @@ class QEChannelOpener(QObject):
self.channelOpenError.emit(_('Problem opening channel: ') + '\n' + repr(e))
return
self._logger.debug('opening channel succeeded')
self.channelOpenSuccess.emit(chan.channel_id.hex(), chan.has_onchain_backup())
# TODO: it would be nice to show this before broadcasting

14
electrum/gui/qml/qetxfinalizer.py

@ -32,6 +32,7 @@ class QETxFinalizer(QObject):
_warning = ''
_target = ''
_rbf = False
_canRbf = False
_outputs = []
config = None
@ -126,6 +127,19 @@ class QETxFinalizer(QObject):
self.update()
self.rbfChanged.emit()
canRbfChanged = pyqtSignal()
@pyqtProperty(bool, notify=canRbfChanged)
def canRbf(self):
return self._canRbf
@canRbf.setter
def canRbf(self, canRbf):
if self._canRbf != canRbf:
self._canRbf = canRbf
self.canRbfChanged.emit()
if not canRbf and self.rbf:
self.rbf = False
outputsChanged = pyqtSignal()
@pyqtProperty('QVariantList', notify=outputsChanged)
def outputs(self):

Loading…
Cancel
Save