From efc46e78f17cbf6d3f6bfedc517fb78077b16143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 14 Jun 2017 12:06:15 +0200 Subject: [PATCH] Fix description of AccountProvider setting. --- ethcore/src/account_provider/mod.rs | 17 +++++++++-------- parity/run.rs | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ethcore/src/account_provider/mod.rs b/ethcore/src/account_provider/mod.rs index 4c099ed85..20d1b5ad8 100755 --- a/ethcore/src/account_provider/mod.rs +++ b/ethcore/src/account_provider/mod.rs @@ -130,8 +130,9 @@ pub struct AccountProvider { transient_sstore: EthMultiStore, /// Accounts in hardware wallets. hardware_store: Option, - /// When unlocking permanently on for some time store a raw secret instead of password. - fast_unlock: bool, + /// When unlocking account permanently we additionally keep a raw secret in memory + /// to increase the performance of transaction signing. + unlock_keep_secret: bool, /// Disallowed accounts. blacklisted_accounts: Vec
, } @@ -142,8 +143,8 @@ pub struct AccountProviderSettings { pub enable_hardware_wallets: bool, /// Use the classic chain key on the hardware wallet. pub hardware_wallet_classic_key: bool, - /// Use fast, but unsafe unlock - pub fast_unlock: bool, + /// Store raw account secret when unlocking the account permanently. + pub unlock_keep_secret: bool, /// Disallowed accounts. pub blacklisted_accounts: Vec
, } @@ -153,7 +154,7 @@ impl Default for AccountProviderSettings { AccountProviderSettings { enable_hardware_wallets: false, hardware_wallet_classic_key: false, - fast_unlock: true, + unlock_keep_secret: false, blacklisted_accounts: vec![], } } @@ -187,7 +188,7 @@ impl AccountProvider { sstore: sstore, transient_sstore: transient_sstore(), hardware_store: hardware_store, - fast_unlock: settings.fast_unlock, + unlock_keep_secret: settings.unlock_keep_secret, blacklisted_accounts: settings.blacklisted_accounts, } } @@ -202,7 +203,7 @@ impl AccountProvider { sstore: Box::new(EthStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")), transient_sstore: transient_sstore(), hardware_store: None, - fast_unlock: false, + unlock_keep_secret: false, blacklisted_accounts: vec![], } } @@ -561,7 +562,7 @@ impl AccountProvider { } } - if self.fast_unlock && unlock != Unlock::OneTime { + if self.unlock_keep_secret && unlock != Unlock::OneTime { // verify password and get the secret let secret = self.sstore.raw_secret(&account, &password)?; self.unlocked_secrets.write().insert(account.clone(), secret); diff --git a/parity/run.rs b/parity/run.rs index 54a2e0d2e..fcbeb5f1f 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -777,7 +777,7 @@ fn prepare_account_provider(spec: &SpecType, dirs: &Directories, data_dir: &str, let account_settings = AccountProviderSettings { enable_hardware_wallets: cfg.enable_hardware_wallets, hardware_wallet_classic_key: spec == &SpecType::Classic, - fast_unlock: cfg.enable_fast_unlock, + unlock_keep_secret: cfg.enable_fast_unlock, blacklisted_accounts: match *spec { SpecType::Morden | SpecType::Ropsten | SpecType::Kovan | SpecType::Dev => vec![], _ => vec![