add label for size in tx window. use base_unit for fee

This commit is contained in:
ThomasV 2016-12-17 17:28:19 +01:00
parent dbf0a6f7a5
commit 0a8f9d49ea
1 changed files with 7 additions and 3 deletions

View File

@ -85,6 +85,8 @@ class TxDialog(QDialog, MessageBoxMixin):
vbox.addWidget(self.date_label)
self.amount_label = QLabel()
vbox.addWidget(self.amount_label)
self.size_label = QLabel()
vbox.addWidget(self.size_label)
self.fee_label = QLabel()
vbox.addWidget(self.fee_label)
@ -177,6 +179,7 @@ class TxDialog(QDialog, MessageBoxMixin):
base_unit = self.main_window.base_unit()
format_amount = self.main_window.format_amount
tx_hash, status, label, can_broadcast, can_rbf, amount, fee, height, conf, timestamp, exp_n = self.wallet.get_tx_info(self.tx)
size = self.tx.estimated_size()
self.broadcast_button.setEnabled(can_broadcast)
self.sign_button.setEnabled(self.wallet.can_sign(self.tx))
self.tx_hash_e.setText(tx_hash or _('Unknown'))
@ -203,12 +206,13 @@ class TxDialog(QDialog, MessageBoxMixin):
amount_str = _("Amount received:") + ' %s'% format_amount(amount) + ' ' + base_unit
else:
amount_str = _("Amount sent:") + ' %s'% format_amount(-amount) + ' ' + base_unit
fee_str = _("Transaction fee") + ': %s'% (format_amount(fee) + ' ' + base_unit if fee is not None else _('unknown'))
size_str = _("Size:") + ' %d bytes'% size
fee_str = _("Fee") + ': %s'% (format_amount(fee) + ' ' + base_unit if fee is not None else _('unknown'))
if fee is not None:
size = self.tx.estimated_size()
fee_str += ' ( %d bytes @ %s ' % (size, format_amount(fee * 1000 / size)) + base_unit + '/kB, %.0d sat/byte )' % (fee/size)
fee_str += ' ( %s )' % (format_amount(fee * 1000 / size) + ' ' + base_unit + '/kB')
self.amount_label.setText(amount_str)
self.fee_label.setText(fee_str)
self.size_label.setText(size_str)
run_hook('transaction_dialog_update', self)
def add_io(self, vbox):