URI: 
       trename wallet methods - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit c47e3499ce051cf76e1850c092c8bfc751ea7d05
   DIR parent 450ab76f78db2fefea126b61b20d227b3c81f9c4
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Sun, 10 Jan 2016 12:56:15 +0100
       
       rename wallet methods
       
       Diffstat:
         M lib/wallet.py                       |      14 +++++++-------
         M plugins/ledger/ledger.py            |       2 +-
         M plugins/trezor/plugin.py            |       2 +-
         M plugins/trustedcoin/trustedcoin.py  |       8 ++++----
       
       4 files changed, 13 insertions(+), 13 deletions(-)
       ---
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -1611,10 +1611,6 @@ class BIP32_Wallet(Deterministic_Wallet):
                xprv, xpub = bip32_private_derivation(root_xprv, root, derivation)
                return xpub, xprv
        
       -    def create_master_keys(self, password):
       -        seed = self.get_seed(password)
       -        self.add_cosigner_seed(seed, self.root_name, password)
       -
            def mnemonic_to_seed(self, seed, password):
                return Mnemonic.mnemonic_to_seed(seed, password)
        
       t@@ -1661,19 +1657,23 @@ class BIP32_RD_Wallet(BIP32_Wallet):
                acc_id, (change, address_index) = self.get_address_index(address)
                return self.address_derivation(acc_id, change, address_index)
        
       -    def add_cosigner_seed(self, seed, name, password, passphrase=''):
       +    def add_xprv_from_seed(self, seed, name, password, passphrase=''):
                # we don't store the seed, only the master xpriv
                xprv, xpub = bip32_root(self.mnemonic_to_seed(seed, passphrase))
                xprv, xpub = bip32_private_derivation(xprv, "m/", self.root_derivation)
                self.add_master_public_key(name, xpub)
                self.add_master_private_key(name, xprv, password)
        
       -    def add_cosigner_xpub(self, seed, name):
       +    def add_xpub_from_seed(self, seed, name):
                # store only master xpub
                xprv, xpub = bip32_root(self.mnemonic_to_seed(seed,''))
                xprv, xpub = bip32_private_derivation(xprv, "m/", self.root_derivation)
                self.add_master_public_key(name, xpub)
        
       +    def create_master_keys(self, password):
       +        seed = self.get_seed(password)
       +        self.add_xprv_from_seed(seed, self.root_name, password)
       +
        
        class BIP32_HD_Wallet(BIP32_RD_Wallet):
            # Abstract base class for a BIP32 wallet that admits account creation
       t@@ -2095,7 +2095,7 @@ class Wallet(object):
                            wallet.add_seed(text, password)
                            wallet.create_master_keys(password)
                        else:
       -                    wallet.add_cosigner_seed(text, name, password)
       +                    wallet.add_xprv_from_seed(text, name, password)
                    else:
                        raise RunTimeError("Cannot handle text for multisig")
                wallet.set_use_encryption(password is not None)
   DIR diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py
       t@@ -426,7 +426,7 @@ class LedgerPlugin(BasePlugin):
                passphrase = unicode()
                password = wizard.request_password()
                wallet.add_seed(seed, password)
       -        wallet.add_cosigner_seed(seed, 'x/', password, passphrase)
       +        wallet.add_xprv_from_seed(seed, 'x/', password, passphrase)
                wallet.create_hd_account(password)
                return wallet
        
   DIR diff --git a/plugins/trezor/plugin.py b/plugins/trezor/plugin.py
       t@@ -339,7 +339,7 @@ class TrezorCompatiblePlugin(BasePlugin, ThreadJob):
                passphrase = wizard.request_passphrase(self.device, restore=True)
                password = wizard.request_password()
                wallet.add_seed(seed, password)
       -        wallet.add_cosigner_seed(seed, 'x/', password, passphrase)
       +        wallet.add_xprv_from_seed(seed, 'x/', password, passphrase)
                wallet.create_hd_account(password)
                return wallet
        
   DIR diff --git a/plugins/trustedcoin/trustedcoin.py b/plugins/trustedcoin/trustedcoin.py
       t@@ -330,8 +330,8 @@ class TrustedCoinPlugin(BasePlugin):
        
                words = seed.split()
                n = len(words)/2
       -        wallet.add_cosigner_seed(' '.join(words[0:n]), 'x1/', password)
       -        wallet.add_cosigner_xpub(' '.join(words[n:]), 'x2/')
       +        wallet.add_xprv_from_seed(' '.join(words[0:n]), 'x1/', password)
       +        wallet.add_xpub_from_seed(' '.join(words[n:]), 'x2/')
        
                wallet.storage.write()
        
       t@@ -360,8 +360,8 @@ class TrustedCoinPlugin(BasePlugin):
                wallet.add_seed(seed, password)
                words = seed.split()
                n = len(words)/2
       -        wallet.add_cosigner_seed(' '.join(words[0:n]), 'x1/', password)
       -        wallet.add_cosigner_seed(' '.join(words[n:]), 'x2/', password)
       +        wallet.add_xprv_from_seed(' '.join(words[0:n]), 'x1/', password)
       +        wallet.add_xpub_from_seed(' '.join(words[n:]), 'x2/', password)
        
                restore_third_key(wallet)
                wallet.create_main_account()