tmove old wallet to subdir - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 07bdd6c494004458e3799ef364a71d6fa5f476c8 DIR parent aaaeac353551d2cfde5c75872d255b67bf71ba53 HTML Author: ThomasV <thomasv@gitorious> Date: Thu, 24 Oct 2013 11:43:55 +0200 move old wallet to subdir Diffstat: M lib/wallet.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) --- DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -92,17 +92,19 @@ class WalletStorage: if path: return path - # default path in pre 1.9 versions - old_path = os.path.join(config.path, "electrum.dat") - if os.path.exists(old_path): - return old_path - # default path dirpath = os.path.join(config.path, "wallets") if not os.path.exists(dirpath): os.mkdir(dirpath) - return os.path.join(config.path, "wallets", "default_wallet") + new_path = os.path.join(config.path, "wallets", "default_wallet") + + # default path in pre 1.9 versions + old_path = os.path.join(config.path, "electrum.dat") + if os.path.exists(old_path) and not os.path.exists(new_path): + os.rename(old_path, new_path) + + return new_path def read(self, path):