From a595102d5f33c1afe651fb26a9fb69c83da4332d Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 10 Mar 2023 15:26:07 +0100 Subject: [PATCH] qml: auto sign and broadcast for cancel txs too --- electrum/gui/qml/components/TxDetails.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml index 4965d5841..8c40c56fc 100644 --- a/electrum/gui/qml/components/TxDetails.qml +++ b/electrum/gui/qml/components/TxDetails.qml @@ -133,6 +133,7 @@ Pane { TextHighlightPane { Layout.fillWidth: true + Layout.topMargin: constants.paddingSmall Layout.columnSpan: 2 borderColor: constants.colorWarning visible: txdetails.canBump || txdetails.canCpfp || txdetails.canCancel @@ -447,7 +448,7 @@ Pane { onTxaccepted: { root.rawtx = rbffeebumper.getNewTx() - if (Daemon.currentWallet.canSignWithoutCosigner) { + if (txdetails.wallet.canSignWithoutCosigner) { txdetails.sign(true) // close txdetails? } else { @@ -474,7 +475,7 @@ Pane { onTxaccepted: { // replaces parent tx with cpfp tx root.rawtx = cpfpfeebumper.getNewTx() - if (Daemon.currentWallet.canSignWithoutCosigner) { + if (txdetails.wallet.canSignWithoutCosigner) { txdetails.sign(true) // close txdetails? } else { @@ -500,7 +501,15 @@ Pane { onTxaccepted: { root.rawtx = txcanceller.getNewTx() - // TODO: sign & send when possible? + if (txdetails.wallet.canSignWithoutCosigner) { + txdetails.sign(true) + // close txdetails? + } else { + var dialog = app.messageDialog.createObject(app, { + text: qsTr('Cancel transaction created.') + '\n\n' + qsTr('You still need to sign and broadcast this transaction.') + }) + dialog.open() + } } onClosed: destroy() }