URI: 
       tcheck if address is imported before index lookup - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit b95911e2d7df558a21baa5a5faecd534a0dea616
   DIR parent 736e1253f29c54b0c40a7b84a4bb64037c392818
  HTML Author: ecdsa <ecdsa@github>
       Date:   Sat,  2 Mar 2013 23:35:43 +0100
       
       check if address is imported before index lookup
       
       Diffstat:
         M lib/wallet.py                       |       6 ++++--
       
       1 file changed, 4 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -785,10 +785,12 @@ class Wallet:
                pk_addresses = []
                for i in range(len(tx.inputs)):
                    txin = tx.inputs[i]
       -            account, is_change, n = self.get_address_index(txin['address'])
       +            address = txin['address']
       +            if address in self.imported_keys.keys(): continue
       +            account, is_change, n = self.get_address_index(address)
       +            txin['electrumKeyID'] = (account, is_change, n) # used by the server to find the key
                    pk_addr, redeemScript = self.sequences[account].get_input_info(is_change, n)
                    txin['redeemScript'] = redeemScript
       -            txin['electrumKeyID'] = (account, is_change, n) # used by the server to find the key
                    pk_addresses.append(pk_addr)
        
                # get all private keys at once.