Skip to content

Commit

Permalink
add --blocking arg to wallet_send
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrobison committed Jun 17, 2020
1 parent 35db4db commit 187c560
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lbry/extras/daemon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1459,20 +1459,22 @@ def jsonrpc_wallet_encrypt(self, new_password, wallet_id=None):
@requires(WALLET_COMPONENT)
async def jsonrpc_wallet_send(
self, amount, addresses, wallet_id=None,
change_account_id=None, funding_account_ids=None, preview=False):
change_account_id=None, funding_account_ids=None, preview=False, blocking=True):
"""
Send the same number of credits to multiple addresses using all accounts in wallet to
fund the transaction and the default account to receive any change.
Usage:
wallet_send <amount> <addresses>... [--wallet_id=<wallet_id>] [--preview]
[--change_account_id=None] [--funding_account_ids=<funding_account_ids>...]
[--blocking]
Options:
--wallet_id=<wallet_id> : (str) restrict operation to specific wallet
--change_account_id=<wallet_id> : (str) account where change will go
--funding_account_ids=<funding_account_ids> : (str) accounts to fund the transaction
--preview : (bool) do not broadcast the transaction
--preview : (bool) do not broadcast the transaction
--blocking : (bool) wait until tx has synced
Returns: {Transaction}
"""
Expand All @@ -1498,13 +1500,11 @@ async def jsonrpc_wallet_send(
tx = await Transaction.create(
[], outputs, accounts, account
)

if not preview:
await self.ledger.broadcast(tx)
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_credits_sent())
else:
await self.ledger.release_tx(tx)

return tx

ACCOUNT_DOC = """
Expand Down

0 comments on commit 187c560

Please sign in to comment.