tminor - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit bf8821f2433c9ead0d36fab8686a39df03a3d6d9 (DIR) parent 63cbda1bd318d74aeeae2bebe51400debed8beea (HTM) Author: ThomasV <thomasv@gitorious> Date: Tue, 29 Nov 2011 14:52:13 +0100 minor Diffstat: M client/upgrade.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- (DIR) diff --git a/client/upgrade.py b/client/upgrade.py t@@ -1,6 +1,11 @@ -import electrum, getpass, base64,ast +import electrum, getpass, base64,ast,sys -wallet = electrum.Wallet(None) + +try: + path = sys.argv[1] +else: + path = None +wallet = electrum.Wallet(path) try: wallet.read() print "ok" t@@ -15,8 +20,7 @@ except BaseException: EncodeAES = lambda secret, s: base64.b64encode(AES.new(secret).encrypt(pad(s))) DecodeAES = lambda secret, e: AES.new(secret).decrypt(base64.b64decode(e)).rstrip(PADDING) - print "encrypted seed", wallet.seed - print "please provide your password" + print "please enter your password" password = getpass.getpass("Password:") secret = electrum.Hash(password) try: t@@ -25,10 +29,8 @@ except BaseException: except: print "sorry" exit(1) - print seed - print private_keys wallet.version = 2 wallet.seed = wallet.pw_encode( seed, password) wallet.private_keys = wallet.pw_encode( repr( private_keys ), password) wallet.save() - print "wallet was upgraded" + print "upgrade successful"