Ejemplo n.º 1
0
 def load_wallet(self, path, password):
     # 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.is_encrypted():
         if not password:
             return
         storage.decrypt(password)
     if storage.requires_split():
         return
     if storage.requires_upgrade():
         self.print_error('upgrading wallet format')
         storage.upgrade()
     if storage.get_action():
         return
     wallet = Wallet(storage)
     wallet.start_threads(self.network)
     self.wallets[path] = wallet
     return wallet
Ejemplo n.º 2
0
 def load_wallet(self, path, password):
     # 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.is_encrypted():
         if not password:
             return
         storage.decrypt(password)
     if storage.requires_split():
         return
     if storage.requires_upgrade():
         self.print_error('upgrading wallet format')
         storage.upgrade()
     if storage.get_action():
         return
     wallet = Wallet(storage)
     wallet.start_threads(self.network)
     self.wallets[path] = wallet
     return wallet