URI: 
       twallet types - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 61e737c38031ff6ae1695f92956b9eb3679ec979
   DIR parent 83b9ecac76e8f570305003aaf4635a6364bc1336
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Wed, 20 Aug 2014 18:54:37 +0200
       
       wallet types
       
       Diffstat:
         M lib/wallet.py                       |      21 +++++++++++----------
       
       1 file changed, 11 insertions(+), 10 deletions(-)
       ---
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -177,6 +177,11 @@ class Abstract_Wallet(object):
                for tx_hash, tx in self.transactions.items():
                    self.update_tx_outputs(tx_hash)
        
       +        # save wallet type the first time
       +        if self.storage.get('wallet_type') is None:
       +            self.storage.put('wallet_type', self.wallet_type, True)
       +
       +
            def load_transactions(self):
                self.transactions = {}
                tx_list = self.storage.get('transactions',{})
       t@@ -1005,13 +1010,13 @@ class Abstract_Wallet(object):
                return not self.is_watching_only()
        
        class Imported_Wallet(Abstract_Wallet):
       +    wallet_type = 'imported'
        
            def __init__(self, storage):
                Abstract_Wallet.__init__(self, storage)
                a = self.accounts.get(IMPORTED_ACCOUNT)
                if not a:
                    self.accounts[IMPORTED_ACCOUNT] = ImportedAccount({'imported':{}})
       -        self.storage.put('wallet_type', 'imported', True)
        
            def is_watching_only(self):
                acc = self.accounts[IMPORTED_ACCOUNT]
       t@@ -1218,6 +1223,7 @@ class Deterministic_Wallet(Abstract_Wallet):
        class BIP32_Wallet(Deterministic_Wallet):
            # Wallet with a single BIP32 account, no seed
            # gap limit 20
       +    root_name = 'x/'
        
            def __init__(self, storage):
                Deterministic_Wallet.__init__(self, storage)
       t@@ -1415,6 +1421,7 @@ class NewWallet(BIP32_HD_Wallet, BIP39_Wallet):
            # bip 44
            root_name = 'root/'
            root_derivation = "m/44'/0'"
       +    wallet_type = 'standard'
        
        
        class Wallet_2of2(BIP39_Wallet):
       t@@ -1422,10 +1429,7 @@ class Wallet_2of2(BIP39_Wallet):
            # Cannot create accounts
            root_name = "x1/"
            root_derivation = "m/44'/0'"
       -
       -    def __init__(self, storage):
       -        BIP39_Wallet.__init__(self, storage)
       -        self.storage.put('wallet_type', '2of2', True)
       +    wallet_type = '2of2'
        
            def can_import(self):
                return False
       t@@ -1453,11 +1457,8 @@ class Wallet_2of2(BIP39_Wallet):
        
        
        class Wallet_2of3(Wallet_2of2):
       -    """ This class is used for multisignature addresses"""
       -
       -    def __init__(self, storage):
       -        Wallet_2of2.__init__(self, storage)
       -        self.storage.put('wallet_type', '2of3', True)
       +    # multisig 2 of 3
       +    wallet_type = '2of3'
        
            def create_main_account(self, password):
                xpub1 = self.master_public_keys.get("x1/")