Fix description of AccountProvider setting.
This commit is contained in:
parent
2e7f29cc9f
commit
efc46e78f1
@ -130,8 +130,9 @@ pub struct AccountProvider {
|
|||||||
transient_sstore: EthMultiStore,
|
transient_sstore: EthMultiStore,
|
||||||
/// Accounts in hardware wallets.
|
/// Accounts in hardware wallets.
|
||||||
hardware_store: Option<HardwareWalletManager>,
|
hardware_store: Option<HardwareWalletManager>,
|
||||||
/// When unlocking permanently on for some time store a raw secret instead of password.
|
/// When unlocking account permanently we additionally keep a raw secret in memory
|
||||||
fast_unlock: bool,
|
/// to increase the performance of transaction signing.
|
||||||
|
unlock_keep_secret: bool,
|
||||||
/// Disallowed accounts.
|
/// Disallowed accounts.
|
||||||
blacklisted_accounts: Vec<Address>,
|
blacklisted_accounts: Vec<Address>,
|
||||||
}
|
}
|
||||||
@ -142,8 +143,8 @@ pub struct AccountProviderSettings {
|
|||||||
pub enable_hardware_wallets: bool,
|
pub enable_hardware_wallets: bool,
|
||||||
/// Use the classic chain key on the hardware wallet.
|
/// Use the classic chain key on the hardware wallet.
|
||||||
pub hardware_wallet_classic_key: bool,
|
pub hardware_wallet_classic_key: bool,
|
||||||
/// Use fast, but unsafe unlock
|
/// Store raw account secret when unlocking the account permanently.
|
||||||
pub fast_unlock: bool,
|
pub unlock_keep_secret: bool,
|
||||||
/// Disallowed accounts.
|
/// Disallowed accounts.
|
||||||
pub blacklisted_accounts: Vec<Address>,
|
pub blacklisted_accounts: Vec<Address>,
|
||||||
}
|
}
|
||||||
@ -153,7 +154,7 @@ impl Default for AccountProviderSettings {
|
|||||||
AccountProviderSettings {
|
AccountProviderSettings {
|
||||||
enable_hardware_wallets: false,
|
enable_hardware_wallets: false,
|
||||||
hardware_wallet_classic_key: false,
|
hardware_wallet_classic_key: false,
|
||||||
fast_unlock: true,
|
unlock_keep_secret: false,
|
||||||
blacklisted_accounts: vec![],
|
blacklisted_accounts: vec![],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,7 +188,7 @@ impl AccountProvider {
|
|||||||
sstore: sstore,
|
sstore: sstore,
|
||||||
transient_sstore: transient_sstore(),
|
transient_sstore: transient_sstore(),
|
||||||
hardware_store: hardware_store,
|
hardware_store: hardware_store,
|
||||||
fast_unlock: settings.fast_unlock,
|
unlock_keep_secret: settings.unlock_keep_secret,
|
||||||
blacklisted_accounts: settings.blacklisted_accounts,
|
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")),
|
sstore: Box::new(EthStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")),
|
||||||
transient_sstore: transient_sstore(),
|
transient_sstore: transient_sstore(),
|
||||||
hardware_store: None,
|
hardware_store: None,
|
||||||
fast_unlock: false,
|
unlock_keep_secret: false,
|
||||||
blacklisted_accounts: vec![],
|
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
|
// verify password and get the secret
|
||||||
let secret = self.sstore.raw_secret(&account, &password)?;
|
let secret = self.sstore.raw_secret(&account, &password)?;
|
||||||
self.unlocked_secrets.write().insert(account.clone(), secret);
|
self.unlocked_secrets.write().insert(account.clone(), secret);
|
||||||
|
@ -777,7 +777,7 @@ fn prepare_account_provider(spec: &SpecType, dirs: &Directories, data_dir: &str,
|
|||||||
let account_settings = AccountProviderSettings {
|
let account_settings = AccountProviderSettings {
|
||||||
enable_hardware_wallets: cfg.enable_hardware_wallets,
|
enable_hardware_wallets: cfg.enable_hardware_wallets,
|
||||||
hardware_wallet_classic_key: spec == &SpecType::Classic,
|
hardware_wallet_classic_key: spec == &SpecType::Classic,
|
||||||
fast_unlock: cfg.enable_fast_unlock,
|
unlock_keep_secret: cfg.enable_fast_unlock,
|
||||||
blacklisted_accounts: match *spec {
|
blacklisted_accounts: match *spec {
|
||||||
SpecType::Morden | SpecType::Ropsten | SpecType::Kovan | SpecType::Dev => vec![],
|
SpecType::Morden | SpecType::Ropsten | SpecType::Kovan | SpecType::Dev => vec![],
|
||||||
_ => vec![
|
_ => vec![
|
||||||
|
Loading…
Reference in New Issue
Block a user