diff --git a/electrum/gui/qml/components/SwapDialog.qml b/electrum/gui/qml/components/SwapDialog.qml index 45a9a754c..abf2b889f 100644 --- a/electrum/gui/qml/components/SwapDialog.qml +++ b/electrum/gui/qml/components/SwapDialog.qml @@ -89,9 +89,6 @@ ElDialog { } RowLayout { - Label { - text: swaphelper.serverfeeperc - } Label { text: Config.formatSats(swaphelper.serverfee) font.family: FixedFont @@ -100,6 +97,9 @@ ElDialog { text: Config.baseUnit color: Material.accentColor } + Label { + text: '(' + swaphelper.serverfeeperc + ')' + } } Label { diff --git a/electrum/gui/qml/qeswaphelper.py b/electrum/gui/qml/qeswaphelper.py index e3b5aec0f..f766216d2 100644 --- a/electrum/gui/qml/qeswaphelper.py +++ b/electrum/gui/qml/qeswaphelper.py @@ -1,4 +1,5 @@ import asyncio +import math from typing import Union from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject @@ -242,7 +243,8 @@ class QESwapHelper(AuthMixin, QObject): # fee breakdown self.serverfeeperc = f'{swap_manager.percentage:0.1f}%' - self.serverfee = QEAmount(amount_sat=swap_manager.lockup_fee) + serverfee = math.ceil(swap_manager.percentage * pay_amount / 100) + swap_manager.lockup_fee + self.serverfee = QEAmount(amount_sat=serverfee) self.miningfee = QEAmount(amount_sat=swap_manager.get_claim_fee()) else: # forward (normal) swap @@ -261,7 +263,8 @@ class QESwapHelper(AuthMixin, QObject): # fee breakdown self.serverfeeperc = f'{swap_manager.percentage:0.1f}%' - self.serverfee = QEAmount(amount_sat=swap_manager.normal_fee) + serverfee = math.ceil(swap_manager.percentage * pay_amount / 100) + swap_manager.normal_fee + self.serverfee = QEAmount(amount_sat=serverfee) self.miningfee = QEAmount(amount_sat=self._tx.get_fee()) if self._tx else QEAmount() if pay_amount and receive_amount: