tfix #2991: encrypt wallet files created with command line - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit dc553ff108c1dbcadb193ad899dd7897f702107e DIR parent 8d307ce1e83f961a3289525708def168c66497dc HTML Author: ThomasV <thomasv@electrum.org> Date: Sun, 15 Oct 2017 09:18:14 +0200 fix #2991: encrypt wallet files created with command line Diffstat: M electrum | 4 +--- M lib/commands.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) --- DIR diff --git a/electrum b/electrum t@@ -177,12 +177,10 @@ def run_non_RPC(config): seed_type = 'segwit' if config.get('segwit') else 'standard' seed = Mnemonic('en').make_seed(seed_type) k = keystore.from_seed(seed, passphrase) - k.update_password(None, password) storage.put('keystore', k.dump()) storage.put('wallet_type', 'standard') - storage.put('use_encryption', bool(password)) - storage.write() wallet = Wallet(storage) + wallet.update_password(None, password, True) wallet.synchronize() print_msg("Your wallet generation seed is:\n\"%s\"" % seed) print_msg("Please keep it in a safe place; if you lose it, you will not be able to restore your wallet.") DIR diff --git a/lib/commands.py b/lib/commands.py t@@ -145,7 +145,8 @@ class Commands: @command('wp') def password(self, password=None, new_password=None): """Change wallet password. """ - self.wallet.update_password(password, new_password) + b = self.wallet.storage.is_encrypted() + self.wallet.update_password(password, new_password, b) self.wallet.storage.write() return {'password':self.wallet.has_password()}