Browse Source

fix can_sign: detect if OldWallet is used

283
ThomasV 10 years ago
parent
commit
0b674eb35d
  1. 2
      lib/wallet.py

2
lib/wallet.py

@ -1048,9 +1048,11 @@ class Abstract_Wallet(object):
addr = bitcoin.public_key_to_bc_address(x_pubkey.decode('hex')) addr = bitcoin.public_key_to_bc_address(x_pubkey.decode('hex'))
return self.is_mine(addr) return self.is_mine(addr)
elif x_pubkey[0:2] == 'ff': elif x_pubkey[0:2] == 'ff':
if isinstance(self, OldWallet): return False
xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey) xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey)
return xpub in [ self.master_public_keys[k] for k in self.master_private_keys.keys() ] return xpub in [ self.master_public_keys[k] for k in self.master_private_keys.keys() ]
elif x_pubkey[0:2] == 'fe': elif x_pubkey[0:2] == 'fe':
if not isinstance(self, OldWallet): return False
xpub, sequence = OldAccount.parse_xpubkey(x_pubkey) xpub, sequence = OldAccount.parse_xpubkey(x_pubkey)
return xpub == self.get_master_public_key() return xpub == self.get_master_public_key()
elif x_pubkey[0:2] == 'fd': elif x_pubkey[0:2] == 'fd':

Loading…
Cancel
Save