electrum

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

commit bb20d618dff6477969539f702420f456b821634d
parent 95586643a4389d900e791aadcee7292a51373945
Author: ThomasV <thomasv@gitorious>
Date:   Thu, 22 Jan 2015 15:33:48 +0100

don't show new_receive_address popup with imported wallets

Diffstat:
Mgui/qt/main_window.py | 16++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -785,18 +785,24 @@ class ElectrumWindow(QMainWindow): self.wallet.storage.put('receive_requests2', self.receive_requests) self.update_receive_tab() - def new_receive_address(self): + def get_receive_address(self): domain = self.wallet.get_account_addresses(self.current_account, include_change=False) for addr in domain: if not self.wallet.history.get(addr) and addr not in self.receive_requests.keys(): - break - else: + return addr + + def new_receive_address(self): + addr = self.get_receive_address() + if addr is None: if isinstance(self.wallet, Imported_Wallet): self.show_message(_('No more addresses in your wallet.')) return if not self.question(_("Warning: The next address will not be recovered automatically if you restore your wallet from seed; you may need to add it manually.\n\nThis occurs because you have too many unused addresses in your wallet. To avoid this situation, use the existing addresses first.\n\nCreate anyway?")): return addr = self.wallet.create_new_address(self.current_account, False) + self.set_receive_address(addr) + + def set_receive_address(self, addr): self.receive_address_e.setText(addr) self.receive_message_e.setText('') self.receive_amount_e.setAmount(None) @@ -850,7 +856,9 @@ class ElectrumWindow(QMainWindow): current_address = self.receive_address_e.text() domain = self.wallet.get_account_addresses(self.current_account, include_change=False) if not current_address in domain: - self.new_receive_address() + addr = self.get_receive_address() + if addr: + self.set_receive_address(addr) # clear the list and fill it again self.receive_list.clear()