X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=lib%2Fwallet.py;h=df3efa8c27cbee27c74f963c918b67469998e8e7;hb=a195ca5c07f5c04314537b29cd77e8d14c5c0f9c;hp=758bbcfb051547c9a78c65a0479cd60117aec01d;hpb=b8f64ad46f16c6b333e17b339d8c303c1ebc867f;p=electrum-nvc.git diff --git a/lib/wallet.py b/lib/wallet.py index 758bbcf..df3efa8 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -352,7 +352,7 @@ class Abstract_Wallet(object): def get_public_keys(self, address): account_id, sequence = self.get_address_index(address) - return self.accounts[account_id].get_pubkeys(sequence) + return self.accounts[account_id].get_pubkeys(*sequence) def add_keypairs(self, tx, keypairs, password): # first check the provided password. This will raise if invalid. @@ -380,19 +380,15 @@ class Abstract_Wallet(object): def signrawtransaction(self, tx, private_keys, password): # check that the password is correct. This will raise if it's not. - self.get_seed(password) - + self.check_password(password) # build a list of public/private keys keypairs = {} - # add private keys from parameter for sec in private_keys: pubkey = public_key_from_private_key(sec) keypairs[ pubkey ] = sec - # add private_keys self.add_keypairs(tx, keypairs, password) - # sign the transaction self.sign_transaction(tx, keypairs, password) @@ -820,11 +816,12 @@ class Abstract_Wallet(object): imported_account.update_password(old_password, new_password) self.save_accounts() - for k, v in self.master_private_keys.items(): - b = pw_decode(v, old_password) - c = pw_encode(b, new_password) - self.master_private_keys[k] = c - self.storage.put('master_private_keys', self.master_private_keys, True) + if hasattr(self, 'master_private_keys'): + for k, v in self.master_private_keys.items(): + b = pw_decode(v, old_password) + c = pw_encode(b, new_password) + self.master_private_keys[k] = c + self.storage.put('master_private_keys', self.master_private_keys, True) self.use_encryption = (new_password != None) self.storage.put('use_encryption', self.use_encryption,True) @@ -1331,12 +1328,6 @@ class NewWallet(Deterministic_Wallet): return True return False - def find_root_by_master_key(self, xpub): - for key, xpub2 in self.master_public_keys.items(): - if key == "m/":continue - if xpub == xpub2: - return key - def num_accounts(self): keys = [] for k, v in self.accounts.items():