From 1b0db8414b4f772ea0d5c0e52e4c4636d17a54c0 Mon Sep 17 00:00:00 2001 From: nelisky Date: Mon, 8 Apr 2013 23:40:51 +0100 Subject: [PATCH] implementing paytomany (untested) Just like mktx/payto, this is only submitting the tx created in mksendmanytx --- electrum | 2 +- lib/commands.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/electrum b/electrum index c20c3be..b92e6a7 100755 --- a/electrum +++ b/electrum @@ -338,7 +338,7 @@ if __name__ == '__main__': domain = [options.from_addr] if options.from_addr else None args = [ 'mktx', args[1], Decimal(args[2]), Decimal(options.tx_fee) if options.tx_fee else None, options.change_addr, domain ] - elif cmd == 'mksendmanytx': + elif cmd in ['paytomany', 'mksendmanytx']: domain = [options.from_addr] if options.from_addr else None outputs = [] for i in range(1, len(args), 2): diff --git a/lib/commands.py b/lib/commands.py index 0641dbe..639d7cb 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -60,8 +60,9 @@ register_command('importprivkey', 1, 1, True, True, 'Import a private k register_command('listaddresses', 3, 3, False, True, 'Returns your list of addresses.', '', listaddr_options) register_command('listunspent', 0, 0, False, True, 'Returns a list of unspent inputs in your wallet.') register_command('mktx', 5, 5, True, True, 'Create a signed transaction', 'mktx [label]', payto_options) -register_command('mksendmanytx', 4, 4, True, True, 'Create a signed transaction', 'mktx [ ...]', payto_options) +register_command('mksendmanytx', 4, 4, True, True, 'Create a signed transaction', 'mksendmanytx [ ...]', payto_options) register_command('payto', 5, 5, True, False, 'Create and broadcast a transaction.', "payto [label]\n can be a bitcoin address or a label", payto_options) +register_command('paytomany', 4, 4, True, False, 'Create and broadcast a transaction.', "paytomany [ ...]\n can be a bitcoin address or a label", payto_options) register_command('password', 0, 0, True, True, 'Change your password') register_command('prioritize', 1, 1, False, True, 'Coins at prioritized addresses are spent first.', 'prioritize
') register_command('restore', 0, 0, False, False, 'Restore a wallet', '', restore_options) @@ -259,6 +260,11 @@ class Commands: r, h = self.wallet.sendtx( tx ) return h + def paytomany(self, outputs, fee = None, change_addr = None, domain = None): + tx = self._mktx(outputs, fee, change_addr, domain) + r, h = self.wallet.sendtx( tx ) + return h + def history(self): import datetime -- 1.7.1