get_private_key: call get_seed first in order to check password
This commit is contained in:
parent
ff647c79fd
commit
eae0c7c3b9
|
@ -697,13 +697,15 @@ class Wallet:
|
||||||
|
|
||||||
|
|
||||||
def get_private_key(self, address, password):
|
def get_private_key(self, address, password):
|
||||||
|
# first check the provided password
|
||||||
|
seed = self.get_seed(password)
|
||||||
|
|
||||||
out = []
|
out = []
|
||||||
if address in self.imported_keys.keys():
|
if address in self.imported_keys.keys():
|
||||||
out.append( pw_decode( self.imported_keys[address], password ) )
|
out.append( pw_decode( self.imported_keys[address], password ) )
|
||||||
else:
|
else:
|
||||||
account, sequence = self.get_address_index(address)
|
account, sequence = self.get_address_index(address)
|
||||||
if account == 0:
|
if account == 0:
|
||||||
seed = self.get_seed(password)
|
|
||||||
pk = self.accounts[account].get_private_key(seed, sequence)
|
pk = self.accounts[account].get_private_key(seed, sequence)
|
||||||
out.append(pk)
|
out.append(pk)
|
||||||
return out
|
return out
|
||||||
|
|
Loading…
Reference in New Issue