From 2ee6683dd002aa3809b0f05b3fcc58f28b93b710 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 15 Aug 2022 07:48:47 +0200 Subject: [PATCH] qml: qetxdetails was missing this in 9eb7ee74e113d0da59ba1cf7157771fed78c2612 --- electrum/gui/qml/qetxdetails.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qml/qetxdetails.py b/electrum/gui/qml/qetxdetails.py index 1f635fe69..25d74fa87 100644 --- a/electrum/gui/qml/qetxdetails.py +++ b/electrum/gui/qml/qetxdetails.py @@ -18,6 +18,7 @@ class QETxDetails(QObject): _status = '' _amount = QEAmount(amount_sat=0) + _lnamount = QEAmount(amount_sat=0) _fee = QEAmount(amount_sat=0) _inputs = [] _outputs = [] @@ -86,6 +87,10 @@ class QETxDetails(QObject): def amount(self): return self._amount + @pyqtProperty(QEAmount, notify=detailsChanged) + def lnAmount(self): + return self._lnamount + @pyqtProperty(QEAmount, notify=detailsChanged) def fee(self): return self._fee @@ -185,7 +190,7 @@ class QETxDetails(QObject): self._status = txinfo.status self._fee = QEAmount(amount_sat=txinfo.fee) - self._is_mined = txinfo.tx_mined_status != None + self._is_mined = False if not txinfo.tx_mined_status else txinfo.tx_mined_status.height > 0 if self._is_mined: self.update_mined_status(txinfo.tx_mined_status) else: @@ -194,6 +199,14 @@ class QETxDetails(QObject): self._logger.error('TX is not mined, yet mempool_depth_bytes is None') self._mempool_depth = self._wallet.wallet.config.depth_tooltip(txinfo.mempool_depth_bytes) + if self._wallet.wallet.lnworker: + lnworker_history = self._wallet.wallet.lnworker.get_onchain_history() + if self._txid in lnworker_history: + item = lnworker_history[self._txid] + self._lnamount = QEAmount(amount_sat=item['amount_msat'] / 1000) + else: + self._lnamount = QEAmount(amount_sat=0) + self._is_lightning_funding_tx = txinfo.is_lightning_funding_tx self._can_bump = txinfo.can_bump self._can_dscancel = txinfo.can_dscancel