1
0

qml QEChannelDetails: show currentFeerate

related https://github.com/spesmilo/electrum/issues/8863
This commit is contained in:
SomberNight
2024-02-03 03:43:16 +00:00
parent d7a9e2d022
commit 16eec8daf5
2 changed files with 19 additions and 0 deletions

View File

@@ -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')

View File

@@ -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()