publish checks all accounts before forwarding to stream_create/stream_update
This commit is contained in:
parent
12a0cbf4e1
commit
65a18e78dd
1 changed files with 7 additions and 2 deletions
|
@ -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.")
|
||||||
|
|
Loading…
Reference in a new issue