electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 21673c95f4b9546e115fa8a128b0c6bb8c74d4b0
parent 80513745d5355e75608849cac775f756609bc355
Author: Maran <maran.hidskes@gmail.com>
Date:   Fri, 24 Apr 2015 13:14:17 +0200

Fix wallet write to support windows

Diffstat:
Mlib/wallet.py | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/wallet.py b/lib/wallet.py @@ -135,15 +135,18 @@ class WalletStorage(object): def write(self): assert not threading.currentThread().isDaemon() + temp_path = self.path + '.tmp' s = json.dumps(self.data, indent=4, sort_keys=True) - with open(self.path + '.tmp', "w") as f: + with open(temp_path, "w") as f: f.write(s) - os.rename(self.path + '.tmp', self.path) + os.remove(self.path) + os.rename(temp_path, self.path) if 'ANDROID_DATA' not in os.environ: import stat os.chmod(self.path,stat.S_IREAD | stat.S_IWRITE) + class Abstract_Wallet(object): """ Wallet classes are created to handle various address generation methods.