from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
-from electrum.i18n import _
-from electrum import Wallet, Wallet_2of2, Wallet_2of3
-from electrum import bitcoin
-from electrum import util
+from electrum_nvc.i18n import _
+from electrum_nvc import Wallet, Wallet_2of2, Wallet_2of3
+from electrum_nvc import bitcoin
+from electrum_nvc import util
import seed_dialog
from network_dialog import NetworkDialog
import sys
import threading
-from electrum.plugins import run_hook
+from electrum_nvc.plugins import run_hook
-MSG_ENTER_ANYTHING = _("Please enter a wallet seed, a master public key, a list of Bitcoin addresses, or a list of private keys")
+MSG_ENTER_ANYTHING = _("Please enter a wallet seed, a master public key, a list of Novacoin addresses, or a list of private keys")
MSG_SHOW_MPK = _("This is your master public key")
MSG_ENTER_MPK = _("Please enter your master public key")
MSG_ENTER_COLD_MPK = _("Please enter the master public key of your cosigner wallet")
return
text1, text2 = r
wallet = Wallet_2of2(self.storage)
+ if Wallet.is_seed(text1) or Wallet.is_seed(text2):
+ password = self.password_dialog()
+ else:
+ password = None
if Wallet.is_seed(text1):
wallet.add_seed(text1, password)
wallet.add_cold_seed(text2, password)
else:
wallet.add_master_public_key("cold/", text2)
-
- elif Wallet.is_xpub(text1):
+ else:
+ assert Wallet.is_xpub(text1)
if Wallet.is_seed(text2):
wallet.add_seed(text2, password)
wallet.add_master_public_key("cold/", text1)
wallet.add_master_public_key("m/", text1)
wallet.add_master_public_key("cold/", text2)
- if wallet.is_watching_only():
- wallet.create_accounts(None)
- else:
- password = self.password_dialog()
- wallet.create_accounts(password)
+ wallet.create_accounts(password)
elif t in ['2of3']:
if not r:
return
text1, text2, text3 = r
- password = self.password_dialog()
wallet = Wallet_2of3(self.storage)
+ if Wallet.is_seed(text1) or Wallet.is_seed(text2) or Wallet.is_seed(text3):
+ password = self.password_dialog()
+ else:
+ password = None
if Wallet.is_seed(text1):
wallet.add_seed(text1, password)
wallet.create_accounts(password)
else:
- raise
-
+ wallet = run_hook('installwizard_restore', self, self.storage)
+ if not wallet:
+ return
# create first keys offline
self.waiting_dialog(wallet.synchronize)