publish checks all accounts before forwarding to stream_create/stream_update

This commit is contained in:
Lex Berezhny 2019-10-17 13:01:02 -04:00
parent 12a0cbf4e1
commit 65a18e78dd

View file

@ -2640,8 +2640,13 @@ class Daemon(metaclass=JSONRPCServerType):
log.info("publishing: name: %s params: %s", name, kwargs) log.info("publishing: name: %s params: %s", name, kwargs)
self.valid_stream_name_or_error(name) self.valid_stream_name_or_error(name)
wallet = self.wallet_manager.get_wallet_or_default(kwargs.get('wallet_id')) wallet = self.wallet_manager.get_wallet_or_default(kwargs.get('wallet_id'))
account = wallet.get_account_or_default(kwargs.get('account_id')) if kwargs.get('account_id'):
claims = await account.get_claims(claim_name=name) accounts = [wallet.get_account_or_error(kwargs.get('account_id'))]
else:
accounts = wallet.accounts
claims = await self.ledger.get_claims(
wallet=wallet, accounts=accounts, claim_name=name
)
if len(claims) == 0: if len(claims) == 0:
if 'bid' not in kwargs: if 'bid' not in kwargs:
raise Exception("'bid' is a required argument for new publishes.") raise Exception("'bid' is a required argument for new publishes.")