remove -b option for listaddresses (fix issue #343)
authorThomasV <thomasv@gitorious>
Thu, 24 Oct 2013 07:45:41 +0000 (09:45 +0200)
committerThomasV <thomasv@gitorious>
Thu, 24 Oct 2013 07:45:41 +0000 (09:45 +0200)
electrum
lib/commands.py

index e9acb67..e3e02e7 100755 (executable)
--- a/electrum
+++ b/electrum
@@ -72,7 +72,6 @@ def arg_parser():
     parser.add_option("-w", "--wallet", dest="wallet_path", help="wallet path (default: electrum.dat)")
     parser.add_option("-o", "--offline", action="store_true", dest="offline", default=False, help="remain offline")
     parser.add_option("-a", "--all", action="store_true", dest="show_all", default=False, help="show all addresses")
-    parser.add_option("-b", "--balance", action="store_true", dest="show_balance", default=False, help="show the balance of listed addresses")
     parser.add_option("-l", "--labels", action="store_true", dest="show_labels", default=False, help="show the labels of listed addresses")
     parser.add_option("-f", "--fee", dest="tx_fee", default=None, help="set tx fee")
     parser.add_option("-F", "--fromaddr", dest="from_addr", default=None, help="set source address for payto/mktx. if it isn't in the wallet, it will ask for the private key unless supplied in the format public_key:private_key. It's not saved in the wallet.")
@@ -290,7 +289,7 @@ if __name__ == '__main__':
         args = [ cmd, json.loads(args[1]), json.loads(args[2])]
 
     elif cmd.name == 'listaddresses':
-        args = [cmd, options.show_all, options.show_balance, options.show_labels]
+        args = [cmd, options.show_all, options.show_labels]
 
     elif cmd.name in ['payto', 'mktx']:
         domain = [options.from_addr] if options.from_addr else None
index a6eb0e6..a88412f 100644 (file)
@@ -43,7 +43,7 @@ def register_command(*args):
 
 
 payto_options = ' --fee, -f: set transaction fee\n --fromaddr, -F: send from address -\n --changeaddr, -c: send change to address'
-listaddr_options = " -a: show all addresses, including change addresses\n -b: include balance in results\n -l: include labels in results"
+listaddr_options = " -a: show all addresses, including change addresses\n -l: include labels in results"
 restore_options = " accepts a seed or master public key."
 config_options = " accounts, addr_history, auto_cycle, column_widths, console-history, contacts,\n fee_per_kb, frozen_addresses, gap_limit, imported_keys, labels,\n master_public_key, num_zeros, prioritized_addresses, proxy, seed,\n seed_version, server, transactions, use_change, use_encryption, winpos-qt"
 mksendmany_syntax = 'mksendmanytx <recipient> <amount> [<recipient> <amount> ...]'
@@ -77,7 +77,7 @@ register_command('getseed',              0, 0, False, True,  True,  'Print the g
 register_command('help',                 0, 1, False, False, False, 'Prints this help')
 register_command('history',              0, 0, True,  True,  False, 'Returns the transaction history of your wallet')
 register_command('importprivkey',        1, 1, False, True,  True,  'Import a private key', 'importprivkey <privatekey>')
-register_command('listaddresses',        3, 3, False, True,  False, 'Returns your list of addresses.', '', listaddr_options)
+register_command('listaddresses',        2, 2, False, True,  False, 'Returns your list of addresses.', '', listaddr_options)
 register_command('listunspent',          0, 0, True,  True,  False, 'Returns the list of unspent inputs in your wallet.')
 register_command('mktx',                 5, 5, False, True,  True,  'Create a signed transaction', 'mktx <recipient> <amount> [label]', payto_options)
 register_command('mksendmanytx',         4, 4, False, True,  True,  'Create a signed transaction', mksendmany_syntax, payto_options)
@@ -325,14 +325,12 @@ class Commands:
         return c
 
 
-    def listaddresses(self, show_all = False, show_balance = False, show_label = False):
+    def listaddresses(self, show_all = False, show_label = False):
         out = []
         for addr in self.wallet.addresses(True):
             if show_all or not self.wallet.is_change(addr):
-                if show_balance or show_label:
+                if show_label:
                     item = { 'address': addr }
-                    if show_balance:
-                        item['balance'] = str(Decimal(self.wallet.get_addr_balance(addr)[0])/100000000)
                     if show_label:
                         label = self.wallet.labels.get(addr,'')
                         if label: