1
0

qml: RbF: do not decrease payment when payment is a swap

ref f617887509
This commit is contained in:
Sander van Grieken
2023-02-14 16:25:14 +01:00
parent 6a6391c6a3
commit d3d66e7248
2 changed files with 12 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ ElDialog {
Layout.preferredWidth: 1 Layout.preferredWidth: 1
Layout.fillWidth: true Layout.fillWidth: true
ElComboBox { ElComboBox {
enabled: rbffeebumper.canChangeBumpMethod
textRole: 'text' textRole: 'text'
valueRole: 'value' valueRole: 'value'

View File

@@ -449,6 +449,12 @@ class QETxRbfFeeBumper(TxFeeSlider, TxMonMixin):
self._orig_tx = None self._orig_tx = None
self._rbf = True self._rbf = True
self._bump_method = 'preserve_payment' self._bump_method = 'preserve_payment'
self._can_change_bump_method = True
canChangeBumpMethodChanged = pyqtSignal()
@pyqtProperty(bool, notify=canChangeBumpMethodChanged)
def canChangeBumpMethod(self):
return self._can_change_bump_method
oldfeeChanged = pyqtSignal() oldfeeChanged = pyqtSignal()
@pyqtProperty(QEAmount, notify=oldfeeChanged) @pyqtProperty(QEAmount, notify=oldfeeChanged)
@@ -479,6 +485,7 @@ class QETxRbfFeeBumper(TxFeeSlider, TxMonMixin):
@bumpMethod.setter @bumpMethod.setter
def bumpMethod(self, bumpmethod): def bumpMethod(self, bumpmethod):
assert self._can_change_bump_method
if self._bump_method != bumpmethod: if self._bump_method != bumpmethod:
self._bump_method = bumpmethod self._bump_method = bumpmethod
self.bumpMethodChanged.emit() self.bumpMethodChanged.emit()
@@ -490,6 +497,9 @@ class QETxRbfFeeBumper(TxFeeSlider, TxMonMixin):
self._orig_tx = self._wallet.wallet.get_input_tx(self._txid) self._orig_tx = self._wallet.wallet.get_input_tx(self._txid)
assert self._orig_tx assert self._orig_tx
if self._wallet.wallet.get_swap_by_funding_tx(self._orig_tx):
self._can_change_bump_method = False
if not isinstance(self._orig_tx, PartialTransaction): if not isinstance(self._orig_tx, PartialTransaction):
self._orig_tx = PartialTransaction.from_tx(self._orig_tx) self._orig_tx = PartialTransaction.from_tx(self._orig_tx)