Beispiel #1
0
    def create(self, passphrase):
        self.wallet_database.begin_updates()
        crypter = Crypter()
        #first create masterkey
        master_key = new_masterkey(passphrase)
        plain_masterkey = decrypt_masterkey(master_key, passphrase)
        self.wallet_database.add_master_key(master_key)
        #create transaction pool
        for i in range(100):
            k = KEY()
            k.generate(True)
            public_key = k.get_pubkey()
            crypter.set_key(plain_masterkey, doublesha256(public_key))
            crypted_secret = crypter.encrypt(k.get_secret())
            self.wallet_database.add_crypted_key(public_key, crypted_secret)
            pool_key = WalletPoolKey(i, 60000, time.time(), public_key)
            self.wallet_database.add_poolkey(pool_key)

        self.wallet_database.commit_updates()
        self.load()
Beispiel #2
0
 def create(self, passphrase):
     self.wallet_database.begin_updates()
     crypter = Crypter()
     #first create masterkey
     master_key =  new_masterkey(passphrase)
     plain_masterkey = decrypt_masterkey(master_key, passphrase)
     self.wallet_database.add_master_key(master_key)
     #create transaction pool
     for i in range(100):
         k = KEY()
         k.generate(True)
         public_key = k.get_pubkey()
         crypter.set_key(plain_masterkey, doublesha256(public_key))
         crypted_secret = crypter.encrypt(k.get_secret())
         self.wallet_database.add_crypted_key(public_key, crypted_secret)
         pool_key = WalletPoolKey(i, 60000, time.time(), public_key)
         self.wallet_database.add_poolkey(pool_key)
         
         
     self.wallet_database.commit_updates()
     self.load()
Beispiel #3
0
 def unlock(self, passphrases):
     for pphrase in passphrases:
         for mkey in self.get_master_keys().values():
             self.plain_masterkeys.append(decrypt_masterkey(mkey, pphrase))
Beispiel #4
0
 def unlock(self, passphrases):
     for pphrase in passphrases:
         for mkey in self.get_master_keys().values():
             self.plain_masterkeys.append(decrypt_masterkey(mkey, pphrase))