コード例 #1
0
ファイル: bitcoin_client.py プロジェクト: sirk390/coinpy
 def open_wallet(self, filename):
     directory, basename = os.path.split(filename)
     dbenv = self.get_dbenv_handle(directory)
     
     uid = bsddb_read_file_uid(filename)
     if uid in dbenv.open_file_uids:
         raise Exception("Multiple wallets with the same uid unsupported in the same directory.")
     wallet_db = BSDDBWalletDatabase(dbenv, basename)
     wallet = Wallet(wallet_db, self.clientparams.runmode)
     wallet.open()
     account = WalletAccount(self.log, basename, wallet, self.blockchain)
     TransactionPublisher(self.node, account)
     self.account_set.add_account(account)
     self.account_infos[account] = (dbenv, directory, basename)
     #add uid last in case something went wrong before
     dbenv.open_file_uids.add(uid)
コード例 #2
0
    def new_wallet(self, filename, passphrase):
        directory, basename = os.path.split(filename)
        dbenv = self.get_dbenv_handle(directory)

        wallet_db = BSDDBWalletDatabase(dbenv, basename)
        wallet_db.create()

        wallet = Wallet(wallet_db, self.clientparams.runmode)
        wallet.create(passphrase)
        #add file uid to list
        dbenv.open_file_uids.add(bsddb_read_file_uid(filename))

        account = WalletAccount(self.log, basename, wallet, self.blockchain)
        TransactionPublisher(self.node, account)
        self.account_set.add_account(account)
        self.account_infos[account] = (dbenv, directory, basename)
コード例 #3
0
ファイル: bitcoin_client.py プロジェクト: sirk390/coinpy
 def new_wallet(self, filename, passphrase):
     directory, basename = os.path.split(filename)
     dbenv = self.get_dbenv_handle(directory)
     
     wallet_db = BSDDBWalletDatabase(dbenv, basename)
     wallet_db.create()
     
     wallet = Wallet(wallet_db, self.clientparams.runmode)
     wallet.create(passphrase)
     #add file uid to list
     dbenv.open_file_uids.add(bsddb_read_file_uid(filename))
     
     
     account = WalletAccount(self.log, basename, wallet, self.blockchain)
     TransactionPublisher(self.node, account)
     self.account_set.add_account(account)
     self.account_infos[account] = (dbenv, directory, basename)
コード例 #4
0
    def open_wallet(self, filename):
        directory, basename = os.path.split(filename)
        dbenv = self.get_dbenv_handle(directory)

        uid = bsddb_read_file_uid(filename)
        if uid in dbenv.open_file_uids:
            raise Exception(
                "Multiple wallets with the same uid unsupported in the same directory."
            )
        wallet_db = BSDDBWalletDatabase(dbenv, basename)
        wallet = Wallet(wallet_db, self.clientparams.runmode)
        wallet.open()
        account = WalletAccount(self.log, basename, wallet, self.blockchain)
        TransactionPublisher(self.node, account)
        self.account_set.add_account(account)
        self.account_infos[account] = (dbenv, directory, basename)
        #add uid last in case something went wrong before
        dbenv.open_file_uids.add(uid)
コード例 #5
0
ファイル: bitcoin_client.py プロジェクト: sirk390/coinpy
 def close_wallet(self, account):
     dbenv, directory, basename = self.account_infos[account]
     uid = bsddb_read_file_uid(os.path.join(directory, basename))
     dbenv.open_file_uids.remove(uid)
     self.account_set.remove_account(account)
     del self.account_infos[account]
コード例 #6
0
 def close_wallet(self, account):
     dbenv, directory, basename = self.account_infos[account]
     uid = bsddb_read_file_uid(os.path.join(directory, basename))
     dbenv.open_file_uids.remove(uid)
     self.account_set.remove_account(account)
     del self.account_infos[account]