wallet_db: add configvar for partial_writes, disable by default
Adds a new configvar `WALLET_PARTIAL_WRITES` to enable/disable partial writes for the walletDB. This is a further restriction on top of the existing restrictions, e.g. wallet files still need to have file encryption disabled for partial writes. It defaults to off, so even for unencrypted wallets we disable partial writes for now. This is used as a stopgap measure until we fix the issues found with the partial writes impl (see https://github.com/spesmilo/electrum/issues/10000).
This commit is contained in:
@@ -151,7 +151,7 @@ def init_cmdline(config_options, wallet_path, *, rpcserver: bool, config: 'Simpl
|
||||
sys_exit(1)
|
||||
|
||||
# instantiate wallet for command-line
|
||||
storage = WalletStorage(wallet_path) if wallet_path else None
|
||||
storage = WalletStorage(wallet_path, allow_partial_writes=config.WALLET_PARTIAL_WRITES) if wallet_path else None
|
||||
|
||||
if cmd.requires_wallet and not storage.file_exists():
|
||||
print_msg("Error: Wallet file not found.")
|
||||
@@ -234,7 +234,7 @@ async def run_offline_command(config: 'SimpleConfig', config_options: dict, wall
|
||||
if 'wallet_path' in cmd.options and config_options.get('wallet_path') is None:
|
||||
config_options['wallet_path'] = wallet_path
|
||||
if cmd.requires_wallet:
|
||||
storage = WalletStorage(wallet_path)
|
||||
storage = WalletStorage(wallet_path, allow_partial_writes=config.WALLET_PARTIAL_WRITES)
|
||||
if storage.is_encrypted():
|
||||
if storage.is_encrypted_with_hw_device():
|
||||
password = get_password_for_hw_device_encrypted_storage(plugins)
|
||||
|
||||
Reference in New Issue
Block a user