From 0843aaafb5ce7a1e460ca6c7cd2b87af5d155750 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 2 Jun 2016 11:30:39 +0200 Subject: [PATCH] gat_wallet_delta: reverse sign of returned fee --- gui/kivy/uix/dialogs/tx_dialog.py | 4 ++-- gui/qt/main_window.py | 1 - gui/qt/transaction_dialog.py | 4 ++-- lib/wallet.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py index 3a55b0c0..7956bde2 100644 --- a/gui/kivy/uix/dialogs/tx_dialog.py +++ b/gui/kivy/uix/dialogs/tx_dialog.py @@ -127,8 +127,8 @@ class TxDialog(Factory.Popup): if is_relevant: if is_mine: if fee is not None: - self.amount_str = self.app.format_amount_and_units(-v+fee) - self.fee_str = self.app.format_amount_and_units(-fee) + self.amount_str = self.app.format_amount_and_units(-v-fee) + self.fee_str = self.app.format_amount_and_units(fee) else: self.amount_str = self.app.format_amount_and_units(-v) self.fee_str = _("unknown") diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index dadd9fd9..125aad6c 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2711,7 +2711,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def bump_fee_dialog(self, tx): is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(tx) - fee = -fee d = WindowModalDialog(self, _('Bump Fee')) vbox = QVBoxLayout(d) vbox.addWidget(QLabel(_('Current fee') + ': %s'% self.format_amount(fee) + ' ' + self.base_unit())) diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py index 10c5362c..3cd34d54 100644 --- a/gui/qt/transaction_dialog.py +++ b/gui/qt/transaction_dialog.py @@ -234,7 +234,7 @@ class TxDialog(QDialog, MessageBoxMixin): if is_relevant: if is_mine: if fee is not None: - amount_str = _("Amount sent:") + ' %s'% format_amount(-v+fee) + ' ' + base_unit + amount_str = _("Amount sent:") + ' %s'% format_amount(-v-fee) + ' ' + base_unit else: amount_str = _("Amount sent:") + ' %s'% format_amount(-v) + ' ' + base_unit else: @@ -244,7 +244,7 @@ class TxDialog(QDialog, MessageBoxMixin): if fee is None: fee = self.wallet.tx_fees.get(tx_hash) - fee_str = _("Transaction fee") + ': %s'% (format_amount(-fee) + ' ' + base_unit if fee is not None else _('unknown')) + fee_str = _("Transaction fee") + ': %s'% (format_amount(fee) + ' ' + base_unit if fee is not None else _('unknown')) self.amount_label.setText(amount_str) self.fee_label.setText(fee_str) diff --git a/lib/wallet.py b/lib/wallet.py index 3c2b0bd0..8b10985f 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -596,7 +596,7 @@ class Abstract_Wallet(PrintError): fee = None else: # all inputs are mine - fee = v_out - v_in + fee = v_in - v_out if not is_mine: fee = None return is_relevant, is_mine, v, fee