URI: 
       ttx dialog: fix confirmation time estimate - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 7f7aa97e2ee56911d8fc518ec2635e026e09f507
   DIR parent b94a7920af0837df84fcb76968e754cbbe5cf972
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Wed,  8 Jun 2016 11:22:58 +0200
       
       ttx dialog: fix confirmation time estimate
       
       Diffstat:
         M gui/kivy/uix/dialogs/tx_dialog.py   |      17 ++++++++++++-----
         M gui/qt/transaction_dialog.py        |       9 +++------
         M lib/wallet.py                       |       2 +-
       
       3 files changed, 16 insertions(+), 12 deletions(-)
       ---
   DIR diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py
       t@@ -104,17 +104,24 @@ class TxDialog(Factory.Popup):
                self.update()
        
            def update(self):
       -        self.tx_hash, self.status_str, self.description, self.can_broadcast, amount, fee, height, conf, timestamp = self.wallet.get_tx_info(self.tx)
       -        self.date_str = datetime.fromtimestamp(timestamp).isoformat(' ')[:-3] if timestamp else ''
       +        format_amount = self.app.format_amount_and_units
       +        self.tx_hash, self.status_str, self.description, self.can_broadcast, amount, fee, height, conf, timestamp, exp_n = self.wallet.get_tx_info(self.tx)
       +        if timestamp:
       +            self.date_str = datetime.fromtimestamp(timestamp).isoformat(' ')[:-3]
       +        elif exp_n:
       +            self.date_str = _('Within %d blocks') % exp_n
       +        else:
       +            self.date_str = ''
       +
                if amount is None:
                    self.amount_str = _("Transaction unrelated to your wallet")
                elif amount > 0:
                    self.is_mine = False
       -            self.amount_str = self.app.format_amount_and_units(amount)
       +            self.amount_str = format_amount(amount)
                else:
                    self.is_mine = True
       -            self.amount_str = self.app.format_amount_and_units(-amount)
       -        self.fee_str = self.app.format_amount_and_units(fee) if fee is not None else _('unknown')
       +            self.amount_str = format_amount(-amount)
       +        self.fee_str = format_amount(fee) if fee is not None else _('unknown')
                self.can_sign = self.wallet.can_sign(self.tx)
                self.ids.output_list.update(self.tx.outputs())
        
   DIR diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py
       t@@ -178,13 +178,10 @@ class TxDialog(QDialog, MessageBoxMixin):
                desc = self.desc
                base_unit = self.main_window.base_unit()
                format_amount = self.main_window.format_amount
       -        tx_hash, status, label, can_broadcast, amount, fee, height, conf, timestamp = self.wallet.get_tx_info(self.tx)
       +        tx_hash, status, label, can_broadcast, amount, fee, height, conf, timestamp, exp_n = self.wallet.get_tx_info(self.tx)
        
                if can_broadcast:
                    self.broadcast_button.show()
       -            # cannot broadcast when offline
       -            if self.main_window.network is None:
       -                self.broadcast_button.setEnabled(False)
                else:
                    self.broadcast_button.hide()
        
       t@@ -201,12 +198,12 @@ class TxDialog(QDialog, MessageBoxMixin):
                    self.tx_desc.show()
                self.status_label.setText(_('Status:') + ' ' + status)
        
       -        if timestamp is not None:
       +        if timestamp:
                    time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3]
                    self.date_label.setText(_("Date: %s")%time_str)
                    self.date_label.show()
                elif exp_n:
       -            self.date_label.setText(_('Expected confirmation time: %d blocks (%s)'%(exp_n, format_amount(fee_per_kb) + ' ' + base_unit + '/kb')))
       +            self.date_label.setText(_('Expected confirmation time: %d blocks'%(exp_n)))
                    self.date_label.show()
                else:
                    self.date_label.hide()
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -643,7 +643,7 @@ class Abstract_Wallet(PrintError):
                else:
                    amount = None
        
       -        return tx_hash, status, label, can_broadcast, amount, fee, height, conf, timestamp
       +        return tx_hash, status, label, can_broadcast, amount, fee, height, conf, timestamp, exp_n
        
        
            def get_addr_io(self, address):