twallet: more powerful add_input_info - electrum - Electrum Bitcoin wallet
 (HTM) git clone https://git.parazyd.org/electrum
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
       ---
 (DIR) commit f53b480f1cd1b572e4c39b249b5c1ff2a0737466
 (DIR) parent f819e9b6f4b8670329bf293bbcd9b37c57004a0e
 (HTM) Author: SomberNight <somber.night@protonmail.com>
       Date:   Mon, 29 Oct 2018 21:34:44 +0100
       
       wallet: more powerful add_input_info
       
       ttangentially related: #4814
       
       also recognise that input is_mine if tx was not fully parsed
       but we have the prevout UTXO
       
       Diffstat:
         M electrum/gui/qt/transaction_dialog… |       4 ++--
         M electrum/wallet.py                  |       2 +-
       
       2 files changed, 3 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py
       t@@ -39,7 +39,7 @@ from electrum.i18n import _
        from electrum.plugin import run_hook
        from electrum import simple_config
        from electrum.util import bfh
       -from electrum.transaction import SerializationError
       +from electrum.transaction import SerializationError, Transaction
        
        from .util import *
        
       t@@ -73,7 +73,7 @@ class TxDialog(QDialog, MessageBoxMixin):
                # Take a copy; it might get updated in the main window by
                # e.g. the FX plugin.  If this happens during or after a long
                # sign operation the signatures are lost.
       -        self.tx = tx = copy.deepcopy(tx)
       +        self.tx = tx = copy.deepcopy(tx)  # type: Transaction
                try:
                    self.tx.deserialize()
                except BaseException as e:
 (DIR) diff --git a/electrum/wallet.py b/electrum/wallet.py
       t@@ -734,7 +734,7 @@ class Abstract_Wallet(AddressSynchronizer):
                raise NotImplementedError()  # implemented by subclasses
        
            def add_input_info(self, txin):
       -        address = txin['address']
       +        address = self.get_txin_address(txin)
                if self.is_mine(address):
                    txin['type'] = self.get_txin_type(address)
                    # segwit needs value to sign