electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 9b22372c4357e775562fad9aedd9e2eb24a6e7b6
parent 00cbb93e96079df893307e8323fa6f4270448b07
Author: ThomasV <thomasv@gitorious>
Date:   Fri, 22 Nov 2013 16:55:43 +0100

remove prioritize altogether.

Diffstat:
Mgui/gtk.py | 15---------------
Mlib/commands.py | 13++-----------
Mlib/wallet.py | 30+-----------------------------
3 files changed, 3 insertions(+), 55 deletions(-)

diff --git a/gui/gtk.py b/gui/gtk.py @@ -1080,20 +1080,6 @@ class ElectrumWindow: button.show() hbox.pack_start(button,False) - button = gtk.Button("Prioritize") - def prioritize_address(w, treeview, liststore, wallet): - path, col = treeview.get_cursor() - if path: - address = liststore.get_value( liststore.get_iter(path), 0) - if address in wallet.prioritized_addresses: - wallet.unprioritize(address) - else: - wallet.prioritize(address) - self.update_receiving_tab() - button.connect("clicked", prioritize_address, treeview, liststore, self.wallet) - button.show() - hbox.pack_start(button,False) - if not is_recv: button = gtk.Button("Pay to") def payto(w, treeview, liststore): @@ -1153,7 +1139,6 @@ class ElectrumWindow: Type = "I" c, u = self.wallet.get_addr_balance(address) if address in self.wallet.frozen_addresses: Type = Type + "F" - if address in self.wallet.prioritized_addresses: Type = Type + "P" label = self.wallet.labels.get(address) h = self.wallet.history.get(address,[]) n = len(h) diff --git a/lib/commands.py b/lib/commands.py @@ -45,7 +45,6 @@ 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 -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> ...]' payto_syntax = "payto <recipient> <amount> [label]\n<recipient> can be a bitcoin address or a label" paytomany_syntax = "paytomany <recipient> <amount> [<recipient> <amount> ...]\n<recipient> can be a bitcoin address or a label" @@ -70,7 +69,7 @@ register_command('getbalance', 0, 1, True, True, False, 'Return the register_command('getservers', 0, 0, True, False, False, 'Return the list of available servers') register_command('getaddressbalance', 1, 1, True, True, False, 'Return the balance of an address', 'getbalance <address>') register_command('getaddresshistory', 1, 1, True, True, False, 'Return the transaction history of a wallet address', 'getaddresshistory <address>') -register_command('getconfig', 1, 1, False, False, False, 'Return a configuration variable', 'getconfig <name>', config_options) +register_command('getconfig', 1, 1, False, False, False, 'Return a configuration variable', 'getconfig <name>') register_command('getpubkeys', 1, 1, False, True, False, 'Return the public keys for a wallet address', 'getpubkeys <bitcoin address>') register_command('getrawtransaction', 1, 2, True, False, False, 'Retrieve a transaction', 'getrawtransaction <txhash> <height>') register_command('getseed', 0, 0, False, True, True, 'Print the generation seed of your wallet.') @@ -85,15 +84,13 @@ register_command('mksendmanytx', 4, 4, False, True, True, 'Create a si register_command('payto', 5, 5, True, True, True, 'Create and broadcast a transaction.', payto_syntax, payto_options) register_command('paytomany', 4, 4, True, True, True, 'Create and broadcast a transaction.', paytomany_syntax, payto_options) register_command('password', 0, 0, False, True, True, 'Change your password') -register_command('prioritize', 1, 1, False, True, False, 'Coins at prioritized addresses are spent first.', 'prioritize <address>') register_command('restore', 0, 0, True, True, False, 'Restore a wallet', '', restore_options) -register_command('setconfig', 2, 2, False, False, False, 'Set a configuration variable', 'setconfig <name> <value>', config_options) +register_command('setconfig', 2, 2, False, False, False, 'Set a configuration variable', 'setconfig <name> <value>') register_command('setlabel', 2,-1, False, True, False, 'Assign a label to an item', 'setlabel <tx_hash> <label>') register_command('sendrawtransaction', 1, 1, True, False, False, 'Broadcasts a transaction to the network.', 'sendrawtransaction <tx in hexadecimal>') register_command('signrawtransaction', 1, 3, False, True, True, 'similar to bitcoind\'s command') register_command('signmessage', 2,-1, False, True, True, 'Sign a message with a key', signmessage_syntax) register_command('unfreeze', 1, 1, False, True, False, 'Unfreeze the funds at one of your wallet\'s address', 'unfreeze <address>') -register_command('unprioritize', 1, 1, False, True, False, 'Unprioritize an address', 'unprioritize <address>') register_command('validateaddress', 1, 1, False, False, False, 'Check that the address is valid', 'validateaddress <address>') register_command('verifymessage', 3,-1, False, False, False, 'Verifies a signature', verifymessage_syntax) @@ -166,12 +163,6 @@ class Commands: def unfreeze(self,addr): return self.wallet.unfreeze(addr) - def prioritize(self, addr): - return self.wallet.prioritize(addr) - - def unprioritize(self, addr): - return self.wallet.unprioritize(addr) - def dumpprivkey(self, addr): return self.wallet.get_private_key(addr, self.password) diff --git a/lib/wallet.py b/lib/wallet.py @@ -167,7 +167,6 @@ class Wallet: self.seed = storage.get('seed', '') # encrypted self.labels = storage.get('labels', {}) self.frozen_addresses = storage.get('frozen_addresses',[]) - self.prioritized_addresses = storage.get('prioritized_addresses',[]) self.addressbook = storage.get('contacts', []) self.imported_keys = storage.get('imported_keys',{}) @@ -987,7 +986,7 @@ class Wallet: def get_address_flags(self, addr): flags = "C" if self.is_change(addr) else "I" if addr in self.imported_keys.keys() else "-" - flags += "F" if addr in self.frozen_addresses else "P" if addr in self.prioritized_addresses else "-" + flags += "F" if addr in self.frozen_addresses else "-" return flags @@ -1151,17 +1150,8 @@ class Wallet: for i in self.frozen_addresses: if i in domain: domain.remove(i) - prioritized = [] - for i in self.prioritized_addresses: - if i in domain: - domain.remove(i) - prioritized.append(i) - coins = self.get_unspent_coins(domain) - prioritized_coins = self.get_unspent_coins(prioritized) - inputs = [] - coins = prioritized_coins + coins for item in coins: if item.get('coinbase') and item.get('height') + COINBASE_MATURITY > self.network.blockchain.height: @@ -1429,7 +1419,6 @@ class Wallet: def freeze(self,addr): if self.is_mine(addr) and addr not in self.frozen_addresses: - self.unprioritize(addr) self.frozen_addresses.append(addr) self.storage.put('frozen_addresses', self.frozen_addresses, True) return True @@ -1444,23 +1433,6 @@ class Wallet: else: return False - def prioritize(self,addr): - if self.is_mine(addr) and addr not in self.prioritized_addresses: - self.unfreeze(addr) - self.prioritized_addresses.append(addr) - self.storage.put('prioritized_addresses', self.prioritized_addresses, True) - return True - else: - return False - - def unprioritize(self,addr): - if self.is_mine(addr) and addr in self.prioritized_addresses: - self.prioritized_addresses.remove(addr) - self.storage.put('prioritized_addresses', self.prioritized_addresses, True) - return True - else: - return False - def set_verifier(self, verifier): self.verifier = verifier