forked from LBRYCommunity/lbry-sdk
fix lint
This commit is contained in:
parent
3924b28cc3
commit
1dc2f0458b
1 changed files with 16 additions and 19 deletions
|
@ -1426,25 +1426,22 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
Returns:
|
Returns:
|
||||||
(str) data
|
(str) data
|
||||||
"""
|
"""
|
||||||
|
assert not data.strip().startswith("{"), "unencrypted wallet import is not implemented yet"
|
||||||
if data.strip().startswith("{"):
|
wallet = self.wallet_manager.get_wallet_or_default(wallet_id)
|
||||||
raise NotImplementedError("unencrypted wallet import is not implemented yet")
|
added_accounts, merged_accounts = wallet.merge(self.wallet_manager, password, data)
|
||||||
else:
|
for new_account in itertools.chain(added_accounts, merged_accounts):
|
||||||
wallet = self.wallet_manager.get_wallet_or_default(wallet_id)
|
await new_account.maybe_migrate_certificates()
|
||||||
added_accounts, merged_accounts = wallet.merge(self.wallet_manager, password, data)
|
if added_accounts and self.ledger.network.is_connected:
|
||||||
for new_account in itertools.chain(added_accounts, merged_accounts):
|
if blocking:
|
||||||
await new_account.maybe_migrate_certificates()
|
await asyncio.wait([
|
||||||
if added_accounts and self.ledger.network.is_connected:
|
a.ledger.subscribe_account(a) for a in added_accounts
|
||||||
if blocking:
|
])
|
||||||
await asyncio.wait([
|
else:
|
||||||
a.ledger.subscribe_account(a) for a in added_accounts
|
for new_account in added_accounts:
|
||||||
])
|
asyncio.create_task(self.ledger.subscribe_account(new_account))
|
||||||
else:
|
wallet.save()
|
||||||
for new_account in added_accounts:
|
encrypted = wallet.pack(password)
|
||||||
asyncio.create_task(self.ledger.subscribe_account(new_account))
|
return encrypted.decode()
|
||||||
wallet.save()
|
|
||||||
encrypted = wallet.pack(password)
|
|
||||||
return encrypted.decode()
|
|
||||||
|
|
||||||
@requires("wallet")
|
@requires("wallet")
|
||||||
async def jsonrpc_wallet_add(self, wallet_id):
|
async def jsonrpc_wallet_add(self, wallet_id):
|
||||||
|
|
Loading…
Add table
Reference in a new issue