wallet_prefill_command working
This commit is contained in:
parent
707ab831fd
commit
14a067a4c4
1 changed files with 6 additions and 13 deletions
|
@ -2455,7 +2455,7 @@ class Daemon(AuthJSONRPCServer):
|
|||
@defer.inlineCallbacks
|
||||
def jsonrpc_wallet_prefill_addresses(self, num_addresses, amount, no_broadcast=False):
|
||||
"""
|
||||
Create new addresses, each containing `amount` credits
|
||||
Create new UTXOs, each containing `amount` credits
|
||||
|
||||
Usage:
|
||||
wallet_prefill_addresses [--no_broadcast]
|
||||
|
@ -2470,19 +2470,12 @@ class Daemon(AuthJSONRPCServer):
|
|||
Returns:
|
||||
(dict) the resulting transaction
|
||||
"""
|
||||
|
||||
amount = self.get_dewies_or_error("amount", amount)
|
||||
|
||||
if amount < 0.0:
|
||||
raise NegativeFundsError()
|
||||
elif not amount:
|
||||
raise NullFundsError()
|
||||
|
||||
broadcast = not no_broadcast
|
||||
tx = yield self.wallet.create_addresses_with_balance(
|
||||
num_addresses, amount, broadcast=broadcast)
|
||||
tx['broadcast'] = broadcast
|
||||
defer.returnValue(tx)
|
||||
return self.jsonrpc_fund(self.wallet.default_account.name,
|
||||
self.wallet.default_account.name,
|
||||
amount=amount,
|
||||
outputs=num_addresses,
|
||||
broadcast=broadcast)
|
||||
|
||||
@requires(WALLET_COMPONENT)
|
||||
@defer.inlineCallbacks
|
||||
|
|
Loading…
Reference in a new issue