Ejemplo n.º 1
0
    def load_wallet(self, path, get_wizard=None):
        if path in self.wallets:
            wallet = self.wallets[path]
        else:
            storage = WalletStorage(path)
            if get_wizard:
                if storage.file_exists:
                    wallet = Wallet(storage)
                    action = wallet.get_action()
                else:
                    action = 'new'
                if action:
                    wizard = get_wizard()
                    wallet = wizard.run(self.network, storage)
                else:
                    wallet.start_threads(self.network)
            else:
                wallet = Wallet(storage)
                # automatically generate wallet for lbrynet
                if not storage.file_exists:
                    seed = wallet.make_seed()
                    wallet.add_seed(seed, None)
                    wallet.create_master_keys(None)
                    wallet.create_main_account()
                    wallet.synchronize()

                wallet.start_threads(self.network)
            if wallet:
                self.wallets[path] = wallet
        return wallet
Ejemplo n.º 2
0
 def __init__(self, config, network, path):
     super(BaseWizard, self).__init__()
     self.config = config
     self.network = network
     self.storage = WalletStorage(path)
     self.wallet = None
     self.stack = []
     self.plugin = None
Ejemplo n.º 3
0
 def __init__(self, config, path):
     super(BaseWizard, self).__init__()
     self.config = config
     self.storage = WalletStorage(path)
     self.wallet = None
     self.stack = []
     self.plugin = None
     self.keystores = []
     self.is_kivy = config.get('gui') == 'kivy'
Ejemplo n.º 4
0
 def load_wallet(self, config):
     path = config.get_wallet_path()
     if path in self.wallets:
         wallet = self.wallets[path]
     else:
         storage = WalletStorage(path)
         wallet = Wallet(storage)
         wallet.start_threads(self.network)
         self.wallets[path] = wallet
     return wallet
Ejemplo n.º 5
0
 def load_wallet(self, path):
     # wizard will be launched if we return
     if path in self.wallets:
         wallet = self.wallets[path]
         return wallet
     storage = WalletStorage(path)
     if not storage.file_exists:
         return
     if storage.requires_split() or storage.requires_upgrade() or storage.get_action():
         return
     wallet = Wallet(storage)
     wallet.start_threads(self.network)
     self.wallets[path] = wallet
     return wallet
Ejemplo n.º 6
0
 def load_wallet(self, path):
     if path in self.wallets:
         wallet = self.wallets[path]
         return wallet
     storage = WalletStorage(path)
     if not storage.file_exists:
         return
     wallet = Wallet(storage)
     action = wallet.get_action()
     if action:
         return
     wallet.start_threads(self.network)
     self.wallets[path] = wallet
     return wallet
Ejemplo n.º 7
0
 def load_wallet(self, path):
     # wizard will be launched if we return
     if path in self.wallets:
         wallet = self.wallets[path]
         return wallet
     storage = WalletStorage(path)
     if not storage.file_exists:
         return
     if storage.requires_upgrade() and 'ANDROID_DATA' in os.environ:
         self.print_error('upgrading wallet format')
         storage.upgrade()
     if storage.requires_split() or storage.requires_upgrade(
     ) or storage.get_action():
         return
     wallet = Wallet(storage)
     wallet.start_threads(self.network)
     self.wallets[path] = wallet
     return wallet
Ejemplo n.º 8
0
 def load_wallet(self, path, get_wizard=None):
     if path in self.wallets:
         wallet = self.wallets[path]
     else:
         storage = WalletStorage(path)
         if storage.file_exists:
             wallet = Wallet(storage)
             action = wallet.get_action()
         else:
             action = 'new'
         if action:
             if get_wizard is None:
                 return None
             wizard = get_wizard()
             wallet = wizard.run(self.network, storage)
         else:
             wallet.start_threads(self.network)
         if wallet:
             self.wallets[path] = wallet
     return wallet