Merge pull request #187 from nelisky/sendmany
authorThomasV <thomasv1@gmx.de>
Sat, 17 Aug 2013 23:55:48 +0000 (16:55 -0700)
committerThomasV <thomasv1@gmx.de>
Sat, 17 Aug 2013 23:55:48 +0000 (16:55 -0700)
merging sendmany attempt in master

1  2 
electrum
lib/commands.py

diff --cc electrum
Simple merge
diff --cc lib/commands.py
@@@ -60,11 -59,13 +60,13 @@@ register_command('importprivkey'
  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 <recipient> <amount> [label]', payto_options)
+ register_command('mksendmanytx',         4, 4, True,  True,  'Create a signed transaction', 'mksendmanytx <recipient> <amount> [<recipient> <amount> ...]', payto_options)
  register_command('payto',                5, 5, True,  False, 'Create and broadcast a transaction.', "payto <recipient> <amount> [label]\n<recipient> can be a bitcoin address or a label", payto_options)
+ register_command('paytomany',            4, 4, True,  False, 'Create and broadcast a transaction.', "paytomany <recipient> <amount> [<recipient> <amount> ...]\n<recipient> 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 <address>')
 -register_command('restore',              0, 0, False, False, 'Restore a wallet')
 -register_command('setconfig',            2, 2, False, True,  'Set a configuration variable', 'setconfig <name> <value>')
 +register_command('restore',              0, 0, False, False, 'Restore a wallet', '', restore_options)
 +register_command('setconfig',            2, 2, False, True,  'Set a configuration variable', 'setconfig <name> <value>', config_options)
  register_command('setlabel',             2,-1, False, True,  'Assign a label to an item', 'setlabel <tx_hash> <label>')
  register_command('sendrawtransaction',   1, 1, False, False, 'Broadcasts a transaction to the network.', 'sendrawtransaction <tx in hexadecimal>')
  register_command('signrawtransaction',   1, 3, True,  True,  'similar to bitcoind\'s command')
@@@ -202,13 -202,19 +204,14 @@@ class Commands
  
  
      def verifymessage(self, address, signature, message):
 -        try:
 -            EC_KEY.verify_message(address, signature, message)
 -            return True
 -        except BaseException as e:
 -            print_error("Verification error: {0}".format(e))
 -            return False
 +        return self.wallet.verify_message(address, signature, message)
  
  
-     def _mktx(self, to_address, amount, fee = None, change_addr = None, domain = None):
+     def _mktx(self, outputs, fee = None, change_addr = None, domain = None):
  
-         if not is_valid(to_address):
-             raise BaseException("Invalid Bitcoin address", to_address)
+         for to_address, amount in outputs:
+             if not is_valid(to_address):
+                 raise BaseException("Invalid Bitcoin address", to_address)
  
          if change_addr:
              if not is_valid(change_addr):