Browse Source

Merge pull request #3004 from SomberNight/wallet_conversion_v13_to_v14

fix: v13 to v14 wallet (with Imported_KeyStore) conversion
seed_v14
ThomasV 7 years ago
committed by GitHub
parent
commit
5127dabb0d
  1. 10
      lib/storage.py

10
lib/storage.py

@ -345,13 +345,13 @@ class WalletStorage(PrintError):
self.put('addresses', addresses)
elif self.get('wallet_type') == 'standard':
if self.get('keystore').get('type')=='imported':
addresses = self.get('addresses').get('receiving')
pubkeys = self.get('pubkeys').get('receiving')
addresses = set(self.get('addresses').get('receiving'))
pubkeys = self.get('keystore').get('keypairs').keys()
assert len(addresses) == len(pubkeys)
d = {}
for i in range(len(addresses)):
addr = addresses[i]
pubkey = pubkeys[i]
for pubkey in pubkeys:
addr = bitcoin.pubkey_to_address('p2pkh', pubkey)
assert addr in addresses
d[addr] = { 'pubkey':pubkey, 'type':'p2pkh'}
self.put('addresses', d)
self.put('pubkeys', None)

Loading…
Cancel
Save