From b396322f1e48aeb4fcb28bfd9f62d5247511ec0a Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 20 Sep 2019 09:36:46 -0400 Subject: [PATCH] removed default_account and default_wallet on Daemon instance --- lbry/lbry/extras/daemon/Daemon.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/lbry/lbry/extras/daemon/Daemon.py b/lbry/lbry/extras/daemon/Daemon.py index f90ff5a11..7394c1c29 100644 --- a/lbry/lbry/extras/daemon/Daemon.py +++ b/lbry/lbry/extras/daemon/Daemon.py @@ -638,20 +638,6 @@ class Daemon(metaclass=JSONRPCServerType): return None, None - @property - def default_wallet(self): - try: - return self.wallet_manager.default_wallet - except AttributeError: - return None - - @property - def default_account(self) -> Optional[LBCAccount]: - try: - return self.wallet_manager.default_account - except AttributeError: - return None - @property def ledger(self) -> Optional['MainNetLedger']: try: @@ -1054,7 +1040,7 @@ class Daemon(metaclass=JSONRPCServerType): value = json.loads(value) account.preferences[key] = value account.modified_on = time.time() - self.default_wallet.save() + wallet.save() return {key: value} WALLET_DOC = """ @@ -1335,13 +1321,13 @@ class Daemon(metaclass=JSONRPCServerType): change_made = True if default: - self.default_wallet.accounts.remove(account) - self.default_wallet.accounts.insert(0, account) + wallet.accounts.remove(account) + wallet.accounts.insert(0, account) change_made = True if change_made: account.modified_on = time.time() - self.default_wallet.save() + wallet.save() return account @@ -2142,7 +2128,7 @@ class Daemon(metaclass=JSONRPCServerType): if not preview: await tx.sign(funding_accounts) account.add_channel_private_key(txo.private_key) - self.default_wallet.save() + wallet.save() await self.broadcast_or_release(tx, blocking) await self.storage.save_claims([self._old_get_temp_claim_info( tx, txo, claim_address, claim, name, dewies_to_lbc(amount) @@ -2290,7 +2276,7 @@ class Daemon(metaclass=JSONRPCServerType): if not preview: await tx.sign(funding_accounts) account.add_channel_private_key(new_txo.private_key) - self.default_wallet.save() + wallet.save() await self.broadcast_or_release(tx, blocking) await self.storage.save_claims([self._old_get_temp_claim_info( tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)