From 16eec8daf50f0719d1c85af8d5fa31ca2f41f8dc Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sat, 3 Feb 2024 03:43:16 +0000 Subject: [PATCH] qml QEChannelDetails: show currentFeerate related https://github.com/spesmilo/electrum/issues/8863 --- electrum/gui/qml/components/ChannelDetails.qml | 12 ++++++++++++ electrum/gui/qml/qechanneldetails.py | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index 50a37c424..0f04f065c 100644 --- a/electrum/gui/qml/components/ChannelDetails.qml +++ b/electrum/gui/qml/components/ChannelDetails.qml @@ -256,6 +256,18 @@ Pane { text: channeldetails.channelType } + Label { + text: qsTr('Current feerate') + color: Material.accentColor + visible: channeldetails.currentFeerate + } + + Label { + Layout.fillWidth: true + text: channeldetails.currentFeerate + visible: channeldetails.currentFeerate + } + Label { visible: channeldetails.isBackup text: qsTr('Backup type') diff --git a/electrum/gui/qml/qechanneldetails.py b/electrum/gui/qml/qechanneldetails.py index 31dff0e47..cb2ab997c 100644 --- a/electrum/gui/qml/qechanneldetails.py +++ b/electrum/gui/qml/qechanneldetails.py @@ -111,6 +111,13 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener): rsa = self._channel.get_remote_scid_alias() return format_short_id(rsa) if rsa else '' + @pyqtProperty(str, notify=channelChanged) + def currentFeerate(self): + if self._channel.is_backup(): + return '' + assert isinstance(self._channel, Channel) + return self._wallet.wallet.config.format_fee_rate(4 * self._channel.get_latest_feerate(LOCAL)) + @pyqtProperty(str, notify=channelChanged) def state(self): return self._channel.get_state_for_GUI()