wallet_prefill_command working

This commit is contained in:
hackrush 2018-08-19 01:48:48 +05:30 committed by Jack Robison
parent 707ab831fd
commit 14a067a4c4
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -2455,7 +2455,7 @@ class Daemon(AuthJSONRPCServer):
@defer.inlineCallbacks @defer.inlineCallbacks
def jsonrpc_wallet_prefill_addresses(self, num_addresses, amount, no_broadcast=False): 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: Usage:
wallet_prefill_addresses [--no_broadcast] wallet_prefill_addresses [--no_broadcast]
@ -2470,19 +2470,12 @@ class Daemon(AuthJSONRPCServer):
Returns: Returns:
(dict) the resulting transaction (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 broadcast = not no_broadcast
tx = yield self.wallet.create_addresses_with_balance( return self.jsonrpc_fund(self.wallet.default_account.name,
num_addresses, amount, broadcast=broadcast) self.wallet.default_account.name,
tx['broadcast'] = broadcast amount=amount,
defer.returnValue(tx) outputs=num_addresses,
broadcast=broadcast)
@requires(WALLET_COMPONENT) @requires(WALLET_COMPONENT)
@defer.inlineCallbacks @defer.inlineCallbacks