From c41e6945345d010a9b2b0f02be159764e1376c16 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 7 Feb 2016 18:05:24 +0900 Subject: [PATCH] show_seed_dialog: return if user cancels p/w input Update stale comment. --- gui/qt/main_window.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 805e0dd2a..81acf097b 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1150,11 +1150,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def protected(func): '''Password request wrapper. The password is passed to the function - as the 'password' named argument. Return value is a 2-element - tuple: (Cancelled, Result) where Cancelled is True if the user - cancels the password request, otherwise False. Result is the - return value of the wrapped function, or None if cancelled. - ''' + as the 'password' named argument. "None" indicates either an + unencrypted wallet, or the user cancelled the password request. + An empty input is passed as the empty string.''' def request_password(self, *args, **kwargs): parent = self.top_level_window() password = None @@ -2024,6 +2022,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): @protected def show_seed_dialog(self, password): + if self.wallet.use_encryption and password is None: + return # User cancelled password input if not self.wallet.has_seed(): self.show_message(_('This wallet has no seed')) return