From f396d151469f22eeb6e23edc62d199428c6751f0 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 1 Apr 2023 12:03:45 +0200 Subject: [PATCH] qml: (clarity) use separate slots for sign and sign_and_broadcast. --- electrum/gui/qml/components/TxDetails.qml | 7 +++---- electrum/gui/qml/qetxdetails.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml index 3e050f24c..d2561e012 100644 --- a/electrum/gui/qml/components/TxDetails.qml +++ b/electrum/gui/qml/components/TxDetails.qml @@ -460,11 +460,10 @@ Pane { wallet: Daemon.currentWallet txid: dialog.txid } - onTxaccepted: { root.rawtx = rbffeebumper.getNewTx() if (txdetails.wallet.canSignWithoutCosigner) { - txdetails.sign(true) + txdetails.sign_and_broadcast() // close txdetails? } else { var dialog = app.messageDialog.createObject(app, { @@ -491,7 +490,7 @@ Pane { // replaces parent tx with cpfp tx root.rawtx = cpfpfeebumper.getNewTx() if (txdetails.wallet.canSignWithoutCosigner) { - txdetails.sign(true) + txdetails.sign_and_broadcast() // close txdetails? } else { var dialog = app.messageDialog.createObject(app, { @@ -517,7 +516,7 @@ Pane { onTxaccepted: { root.rawtx = txcanceller.getNewTx() if (txdetails.wallet.canSignWithoutCosigner) { - txdetails.sign(true) + txdetails.sign_and_broadcast() // close txdetails? } else { var dialog = app.messageDialog.createObject(app, { diff --git a/electrum/gui/qml/qetxdetails.py b/electrum/gui/qml/qetxdetails.py index a4ba47971..ed032c91b 100644 --- a/electrum/gui/qml/qetxdetails.py +++ b/electrum/gui/qml/qetxdetails.py @@ -299,8 +299,14 @@ class QETxDetails(QObject, QtEventListener): self._short_id = tx_mined_info.short_id() or "" @pyqtSlot() - @pyqtSlot(bool) - def sign(self, broadcast = False): + def sign_and_broadcast(self): + self._sign(broadcast=True) + + @pyqtSlot() + def sign(self): + self._sign(broadcast=False) + + def _sign(self, broadcast): # TODO: connecting/disconnecting signal handlers here is hmm try: self._wallet.transactionSigned.disconnect(self.onSigned)