mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 10:15:20 +00:00
wizard: fix imported address wallets
assertion added in 9350709f13
was failing
This commit is contained in:
parent
1e8b34e63e
commit
664b0c234e
3 changed files with 6 additions and 5 deletions
|
@ -194,7 +194,7 @@ class BaseWizard(object):
|
|||
if keystore.is_address_list(text):
|
||||
w = Imported_Wallet(self.storage)
|
||||
addresses = text.split()
|
||||
good_inputs, bad_inputs = w.import_addresses(addresses)
|
||||
good_inputs, bad_inputs = w.import_addresses(addresses, write_to_disk=False)
|
||||
elif keystore.is_private_key_list(text):
|
||||
k = keystore.Imported_KeyStore({})
|
||||
self.storage.put('keystore', k.dump())
|
||||
|
|
|
@ -167,7 +167,7 @@ class Commands:
|
|||
if keystore.is_address_list(text):
|
||||
wallet = Imported_Wallet(storage)
|
||||
addresses = text.split()
|
||||
good_inputs, bad_inputs = wallet.import_addresses(addresses)
|
||||
good_inputs, bad_inputs = wallet.import_addresses(addresses, write_to_disk=False)
|
||||
# FIXME tell user about bad_inputs
|
||||
if not good_inputs:
|
||||
raise Exception("None of the given addresses can be imported")
|
||||
|
|
|
@ -1329,7 +1329,8 @@ class Imported_Wallet(Simple_Wallet):
|
|||
def get_change_addresses(self):
|
||||
return []
|
||||
|
||||
def import_addresses(self, addresses: List[str]) -> Tuple[List[str], List[Tuple[str, str]]]:
|
||||
def import_addresses(self, addresses: List[str], *,
|
||||
write_to_disk=True) -> Tuple[List[str], List[Tuple[str, str]]]:
|
||||
good_addr = [] # type: List[str]
|
||||
bad_addr = [] # type: List[Tuple[str, str]]
|
||||
for address in addresses:
|
||||
|
@ -1343,7 +1344,7 @@ class Imported_Wallet(Simple_Wallet):
|
|||
self.addresses[address] = {}
|
||||
self.add_address(address)
|
||||
self.save_addresses()
|
||||
self.save_transactions(write=True)
|
||||
self.save_transactions(write=write_to_disk)
|
||||
return good_addr, bad_addr
|
||||
|
||||
def import_address(self, address: str) -> str:
|
||||
|
@ -1408,7 +1409,7 @@ class Imported_Wallet(Simple_Wallet):
|
|||
def get_public_key(self, address):
|
||||
return self.addresses[address].get('pubkey')
|
||||
|
||||
def import_private_keys(self, keys: List[str], password: Optional[str],
|
||||
def import_private_keys(self, keys: List[str], password: Optional[str], *,
|
||||
write_to_disk=True) -> Tuple[List[str], List[Tuple[str, str]]]:
|
||||
good_addr = [] # type: List[str]
|
||||
bad_keys = [] # type: List[Tuple[str, str]]
|
||||
|
|
Loading…
Add table
Reference in a new issue