ThomasV 8 years ago
parent
commit
03c66bb5f9
  1. 17
      lib/keystore.py

17
lib/keystore.py

@ -161,7 +161,7 @@ class Imported_KeyStore(Software_KeyStore):
return pubkey return pubkey
def get_xpubkey(self, c, i): def get_xpubkey(self, c, i):
return self.get_public_key((c,i)).encode('hex') return self.get_public_key((c,i))
def get_private_key(self, sequence, password): def get_private_key(self, sequence, password):
for_change, i = sequence for_change, i = sequence
@ -174,13 +174,16 @@ class Imported_KeyStore(Software_KeyStore):
return pk return pk
def get_pubkey_derivation(self, x_pubkey): def get_pubkey_derivation(self, x_pubkey):
if x_pubkey[0:2] != 'fd': if x_pubkey[0:2] in ['02', '03', '04']:
return if x_pubkey in self.receiving_pubkeys:
# fixme: this assumes p2pkh i = self.receiving_pubkeys.index(x_pubkey)
_, addr = xpubkey_to_address(x_pubkey)
for i, pubkey in enumerate(self.receiving_pubkeys):
if public_key_to_bc_address(pubkey.decode('hex')) == addr:
return (False, i) return (False, i)
elif x_pubkey[0:2] == 'fd':
# fixme: this assumes p2pkh
_, addr = xpubkey_to_address(x_pubkey)
for i, pubkey in enumerate(self.receiving_pubkeys):
if public_key_to_bc_address(pubkey.decode('hex')) == addr:
return (False, i)
def update_password(self, old_password, new_password): def update_password(self, old_password, new_password):
if old_password is not None: if old_password is not None:

Loading…
Cancel
Save