Fixed download URL (from github to electrum.bitcoin.cz)
[electrum-nvc.git] / electrum
index 9ee2d1d..4ce9fdd 100755 (executable)
--- a/electrum
+++ b/electrum
@@ -71,7 +71,7 @@ options:\n  --fee, -f: set transaction fee\n  --fromaddr, -s: send from address
     'seed':
             "Print the generation seed of your wallet.",
     'importprivkey': 
-            'Imports a key pair\nSyntax: import <address>:<privatekey>',
+            'Import a private key\nSyntax: importprivkey <privatekey>',
     'signmessage':
             'Signs a message with a key\nSyntax: signmessage <address> <message>\nIf you want to lead or end a message with spaces, or want double spaces inside the message make sure you quote the string. I.e. " Hello  This is a weird String "',
     'verifymessage':
@@ -139,6 +139,7 @@ def arg_parser():
     parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="show debugging information")
     parser.add_option("-P", "--portable", action="store_true", dest="portable", default=False, help="portable wallet")
     parser.add_option("-L", "--lang", dest="language", default=None, help="defaut language used in GUI")
+    parser.add_option("-u", "--usb", dest="bitkey", action="store_true", help="Turn on support for hardware wallets (EXPERIMENTAL)")
     return parser
 
 
@@ -223,8 +224,18 @@ if __name__ == '__main__':
                 wallet.init_mpk( wallet.seed )
             else:
                 # ask for seed and gap.
-                if not gui.seed_dialog(): exit()
-                wallet.init_mpk( wallet.seed )
+                sg = gui.seed_dialog()
+                if not sg: exit()
+                seed, gap = sg
+                if not seed: exit()
+                wallet.gap_limit = gap
+                if len(seed) == 128:
+                    wallet.seed = None
+                    wallet.master_public_key = seed
+                else:
+                    wallet.seed = str(seed)
+                    wallet.init_mpk( wallet.seed )
+            
 
             # generate the first addresses, in case we are offline
             if s is None or a == 'create':
@@ -304,10 +315,14 @@ if __name__ == '__main__':
             if not seed:
                 sys.exit("Error: No seed")
 
-            wallet.seed = str(seed)
-            wallet.init_mpk( wallet.seed )
-            if not options.offline:
+            if len(seed) == 128:
+                wallet.seed = None
+                wallet.master_public_key = seed
+            else:
+                wallet.seed = str(seed)
+                wallet.init_mpk( wallet.seed )
 
+            if not options.offline:
                 interface = Interface(config)
                 interface.start()
                 wallet.interface = interface
@@ -394,6 +409,7 @@ if __name__ == '__main__':
                 exit(1)
         else:
             password = None
+            seed = wallet.seed
 
     if cmd == 'importprivkey':
         # See if they specificed a key on the cmd line, if not prompt