show_seed_dialog: return if user cancels p/w input

Update stale comment.
This commit is contained in:
Neil Booth 2016-02-07 18:05:24 +09:00
parent 6b9d12e369
commit c41e694534
1 changed files with 5 additions and 5 deletions

View File

@ -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