Browse Source

qml QEChannelDetails: show currentFeerate

related https://github.com/spesmilo/electrum/issues/8863
master
SomberNight 2 years ago
parent
commit
16eec8daf5
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 12
      electrum/gui/qml/components/ChannelDetails.qml
  2. 7
      electrum/gui/qml/qechanneldetails.py

12
electrum/gui/qml/components/ChannelDetails.qml

@ -256,6 +256,18 @@ Pane {
text: channeldetails.channelType 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 { Label {
visible: channeldetails.isBackup visible: channeldetails.isBackup
text: qsTr('Backup type') text: qsTr('Backup type')

7
electrum/gui/qml/qechanneldetails.py

@ -111,6 +111,13 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
rsa = self._channel.get_remote_scid_alias() rsa = self._channel.get_remote_scid_alias()
return format_short_id(rsa) if rsa else '' 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) @pyqtProperty(str, notify=channelChanged)
def state(self): def state(self):
return self._channel.get_state_for_GUI() return self._channel.get_state_for_GUI()

Loading…
Cancel
Save