|
|
@ -1,5 +1,6 @@ |
|
|
|
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject |
|
|
|
|
|
|
|
from electrum.i18n import _ |
|
|
|
from electrum.logging import get_logger |
|
|
|
from electrum.util import format_time |
|
|
|
from electrum.transaction import tx_from_any |
|
|
@ -21,9 +22,9 @@ class QETxDetails(QObject): |
|
|
|
_tx = None |
|
|
|
|
|
|
|
_status = '' |
|
|
|
_amount = QEAmount(amount_sat=0) |
|
|
|
_lnamount = QEAmount(amount_sat=0) |
|
|
|
_fee = QEAmount(amount_sat=0) |
|
|
|
_amount = QEAmount() |
|
|
|
_lnamount = QEAmount() |
|
|
|
_fee = QEAmount() |
|
|
|
_inputs = [] |
|
|
|
_outputs = [] |
|
|
|
|
|
|
@ -47,6 +48,8 @@ class QETxDetails(QObject): |
|
|
|
_txpos = -1 |
|
|
|
_header_hash = '' |
|
|
|
|
|
|
|
confirmRemoveLocalTx = pyqtSignal([str], arguments=['message']) |
|
|
|
|
|
|
|
detailsChanged = pyqtSignal() |
|
|
|
|
|
|
|
walletChanged = pyqtSignal() |
|
|
@ -305,3 +308,21 @@ class QETxDetails(QObject): |
|
|
|
|
|
|
|
self._can_broadcast = True |
|
|
|
self.detailsChanged.emit() |
|
|
|
|
|
|
|
@pyqtSlot() |
|
|
|
@pyqtSlot(bool) |
|
|
|
def removeLocalTx(self, confirm = False): |
|
|
|
txid = self._txid |
|
|
|
|
|
|
|
if not confirm: |
|
|
|
num_child_txs = len(self._wallet.wallet.adb.get_depending_transactions(txid)) |
|
|
|
question = _("Are you sure you want to remove this transaction?") |
|
|
|
if num_child_txs > 0: |
|
|
|
question = ( |
|
|
|
_("Are you sure you want to remove this transaction and {} child transactions?") |
|
|
|
.format(num_child_txs)) |
|
|
|
self.confirmRemoveLocalTx.emit(question) |
|
|
|
return |
|
|
|
|
|
|
|
self._wallet.wallet.adb.remove_transaction(txid) |
|
|
|
self._wallet.wallet.save_db() |
|
|
|