URI: 
       tMerge pull request #1436 from keepkey/master - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit c3fb7fdb1deb21207b26a9d2926d3069020801ec
   DIR parent c33b223cbec3cda1878fb34046ae10538b2269c7
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Tue,  1 Sep 2015 18:10:41 +0200
       
       Merge pull request #1436 from keepkey/master
       
       fixed attempt to access account derivation before it is created
       Diffstat:
         M plugins/keepkey.py                  |       6 +++---
         M plugins/trezor.py                   |       6 +++---
       
       2 files changed, 6 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/plugins/keepkey.py b/plugins/keepkey.py
       t@@ -289,8 +289,6 @@ class Plugin(BasePlugin):
                                            xpub_n = self.get_client().expand_path(self.xpub_path[xpub])
                                            txinputtype.address_n.extend(xpub_n + s)
                                            break
       -                                else:
       -                                    raise
        
                        prev_hash = unhexlify(txin['prevout_hash'])
                        prev_index = txin['prevout_n']
       t@@ -484,6 +482,7 @@ class KeepKeyWallet(BIP32_HD_Wallet):
                    prev_tx[tx_hash] = ptx
        
                    for x_pubkey in txin['x_pubkeys']:
       +                account_derivation = None
                        if not is_extended_pubkey(x_pubkey):
                            continue
                        xpub = x_to_xpub(x_pubkey)
       t@@ -491,7 +490,8 @@ class KeepKeyWallet(BIP32_HD_Wallet):
                            if v == xpub:
                                account_id = re.match("x/(\d+)'", k).group(1)
                                account_derivation = "44'/0'/%s'"%account_id
       -                xpub_path[xpub] = account_derivation
       +                if account_derivation is not None:
       +                    xpub_path[xpub] = account_derivation
        
                self.plugin.sign_transaction(tx, prev_tx, xpub_path)
        
   DIR diff --git a/plugins/trezor.py b/plugins/trezor.py
       t@@ -288,8 +288,6 @@ class Plugin(BasePlugin):
                                            xpub_n = self.get_client().expand_path(self.xpub_path[xpub])
                                            txinputtype.address_n.extend(xpub_n + s)
                                            break
       -                                else:
       -                                    raise
        
                        prev_hash = unhexlify(txin['prevout_hash'])
                        prev_index = txin['prevout_n']
       t@@ -483,6 +481,7 @@ class TrezorWallet(BIP32_HD_Wallet):
                    prev_tx[tx_hash] = ptx
        
                    for x_pubkey in txin['x_pubkeys']:
       +                account_derivation = None
                        if not is_extended_pubkey(x_pubkey):
                            continue
                        xpub = x_to_xpub(x_pubkey)
       t@@ -490,7 +489,8 @@ class TrezorWallet(BIP32_HD_Wallet):
                            if v == xpub:
                                account_id = re.match("x/(\d+)'", k).group(1)
                                account_derivation = "44'/0'/%s'"%account_id
       -                xpub_path[xpub] = account_derivation
       +                if account_derivation is not None:
       +                    xpub_path[xpub] = account_derivation
        
                self.plugin.sign_transaction(tx, prev_tx, xpub_path)