Merge pull request #2071 from neocogent/tx_fee_info
Add fee rate to transaction details dialog.
This commit is contained in:
commit
77d5450081
|
@ -204,6 +204,9 @@ class TxDialog(QDialog, MessageBoxMixin):
|
||||||
else:
|
else:
|
||||||
amount_str = _("Amount sent:") + ' %s'% format_amount(-amount) + ' ' + base_unit
|
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'))
|
fee_str = _("Transaction 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)
|
||||||
self.amount_label.setText(amount_str)
|
self.amount_label.setText(amount_str)
|
||||||
self.fee_label.setText(fee_str)
|
self.fee_label.setText(fee_str)
|
||||||
run_hook('transaction_dialog_update', self)
|
run_hook('transaction_dialog_update', self)
|
||||||
|
|
|
@ -670,7 +670,7 @@ class Transaction:
|
||||||
@profiler
|
@profiler
|
||||||
def estimated_size(self):
|
def estimated_size(self):
|
||||||
'''Return an estimated tx size in bytes.'''
|
'''Return an estimated tx size in bytes.'''
|
||||||
return len(self.serialize(-1)) / 2 # ASCII hex string
|
return len(self.serialize(-1)) / 2 if not self.is_complete() or self.raw is None else len(self.raw) / 2 # ASCII hex string
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def estimated_input_size(self, txin):
|
def estimated_input_size(self, txin):
|
||||||
|
|
Loading…
Reference in New Issue