1
0

allow password encryption in hardware wallets

This commit is contained in:
ThomasV
2025-05-23 12:19:14 +02:00
parent f95d4ce287
commit 45c35c0b00
5 changed files with 84 additions and 90 deletions

View File

@@ -644,9 +644,11 @@ class NewWalletWizard(AbstractWizard):
k.update_password(None, data['password'])
if data['encrypt']:
enc_version = StorageEncryptionVersion.USER_PASSWORD
if data.get('keystore_type') == 'hardware' and data['wallet_type'] == 'standard':
if data.get('xpub_encrypt'):
assert data.get('keystore_type') == 'hardware' and data['wallet_type'] == 'standard'
enc_version = StorageEncryptionVersion.XPUB_PASSWORD
else:
enc_version = StorageEncryptionVersion.USER_PASSWORD
storage.set_password(data['password'], enc_version=enc_version)
db = WalletDB('', storage=storage, upgrade=True)