tremove -b option for listaddresses (fix issue #343) - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 8b1c6fba685cea6c315164cc472f46ae81a2e70b DIR parent b0289609c9f7a4a3c34225a29d6c0043e5f090ee HTML Author: ThomasV <thomasv@gitorious> Date: Thu, 24 Oct 2013 09:45:41 +0200 remove -b option for listaddresses (fix issue #343) Diffstat: M electrum | 3 +-- M lib/commands.py | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) --- DIR diff --git a/electrum b/electrum t@@ -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.") t@@ -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 DIR diff --git a/lib/commands.py b/lib/commands.py t@@ -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> ...]' t@@ -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) t@@ -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: