From 0f227b177c93225a2ed92e25d003a490a77baf69 Mon Sep 17 00:00:00 2001
From: Sander van Grieken <sander@outrightsolutions.nl>
Date: Tue, 16 Aug 2022 10:00:43 +0200
Subject: [PATCH] qml: use QEAmount setters also in qetxdetails

---
 electrum/gui/qml/qetxdetails.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/electrum/gui/qml/qetxdetails.py b/electrum/gui/qml/qetxdetails.py
index 25d74fa87..42a530405 100644
--- a/electrum/gui/qml/qetxdetails.py
+++ b/electrum/gui/qml/qetxdetails.py
@@ -183,29 +183,26 @@ class QETxDetails(QObject):
         # can be None if outputs unrelated to wallet seed,
         # e.g. to_local local_force_close commitment CSV-locked p2wsh script
         if txinfo.amount is None:
-            self._amount = QEAmount(amount_sat=0)
+            self._amount.satsInt = 0
         else:
-            self._amount = QEAmount(amount_sat=txinfo.amount)
+            self._amount.satsInt = txinfo.amount
 
         self._status = txinfo.status
-        self._fee = QEAmount(amount_sat=txinfo.fee)
+        self._fee.satsInt = txinfo.fee
 
         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:
-            # TODO mempool_depth_bytes can be None if not mined?
-            if txinfo.mempool_depth_bytes is None:
-                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)
+                self._lnamount.satsInt = int(item['amount_msat'] / 1000)
             else:
-                self._lnamount = QEAmount(amount_sat=0)
+                self._lnamount.satsInt = 0
 
         self._is_lightning_funding_tx = txinfo.is_lightning_funding_tx
         self._can_bump = txinfo.can_bump