From 84fc4574d6709788b685dcd801c25401676c04e0 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 23 Jan 2015 00:06:17 +0100 Subject: [PATCH] add password when creating imported wallet --- gui/qt/installwizard.py | 3 ++- lib/wallet.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py index 46f954ae..d444a4fb 100644 --- a/gui/qt/installwizard.py +++ b/gui/qt/installwizard.py @@ -443,7 +443,8 @@ class InstallWizard(QDialog): elif Wallet.is_address(text): wallet = Wallet.from_address(text, self.storage) elif Wallet.is_private_key(text): - wallet = Wallet.from_private_key(text, self.storage) + password = self.password_dialog() + wallet = Wallet.from_private_key(text, password, self.storage) elif Wallet.is_seed(text): password = self.password_dialog() wallet = Wallet.from_seed(text, self.storage) diff --git a/lib/wallet.py b/lib/wallet.py index 198eae53..e65b4a7d 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1728,10 +1728,11 @@ class Wallet(object): return w @classmethod - def from_private_key(self, text, storage): + def from_private_key(self, text, password, storage): w = Imported_Wallet(storage) + w.update_password(None, password) for x in text.split(): - w.import_key(x, None) + w.import_key(x, password) return w @classmethod