--unlock is comma-delimited.

This commit is contained in:
Gav Wood 2016-04-09 12:58:13 -07:00
parent 373284ca0a
commit 6ebd5009fc
2 changed files with 12 additions and 10 deletions

View File

@ -104,7 +104,8 @@ Protocol Options:
--identity NAME Specify your node's name. --identity NAME Specify your node's name.
Account Options: Account Options:
--unlock ACCOUNT Unlock ACCOUNT for the duration of the execution. --unlock ACCOUNTS Unlock ACCOUNTS for the duration of the execution.
ACCOUNTS is a comma-delimited list of addresses.
--password FILE Provide a file containing a password for unlocking --password FILE Provide a file containing a password for unlocking
an account. an account.
@ -213,7 +214,7 @@ struct Args {
flag_chain: String, flag_chain: String,
flag_db_path: String, flag_db_path: String,
flag_identity: String, flag_identity: String,
flag_unlock: Vec<String>, flag_unlock: Option<String>,
flag_password: Vec<String>, flag_password: Vec<String>,
flag_cache: Option<usize>, flag_cache: Option<usize>,
flag_keys_path: String, flag_keys_path: String,
@ -617,9 +618,9 @@ impl Configuration {
.collect::<Vec<_>>() .collect::<Vec<_>>()
.into_iter() .into_iter()
}).collect::<Vec<_>>(); }).collect::<Vec<_>>();
let account_service = AccountService::new_in(Path::new(&self.keys_path())); let account_service = AccountService::new_in(Path::new(&self.keys_path()));
for d in &self.args.flag_unlock { if let Some(ref unlocks) = self.args.flag_unlock {
for d in unlocks.split(',') {
let a = Address::from_str(clean_0x(&d)).unwrap_or_else(|_| { let a = Address::from_str(clean_0x(&d)).unwrap_or_else(|_| {
die!("{}: Invalid address for --unlock. Must be 40 hex characters, without the 0x at the beginning.", d) die!("{}: Invalid address for --unlock. Must be 40 hex characters, without the 0x at the beginning.", d)
}); });
@ -627,6 +628,7 @@ impl Configuration {
die!("No password given to unlock account {}. Pass the password using `--password`.", a); die!("No password given to unlock account {}. Pass the password using `--password`.", a);
} }
} }
}
account_service account_service
} }

View File

@ -465,7 +465,7 @@ impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM>
fn submit_work(&self, params: Params) -> Result<Value, Error> { fn submit_work(&self, params: Params) -> Result<Value, Error> {
from_params::<(H64, H256, H256)>(params).and_then(|(nonce, pow_hash, mix_hash)| { from_params::<(H64, H256, H256)>(params).and_then(|(nonce, pow_hash, mix_hash)| {
// trace!("Decoded: nonce={}, pow_hash={}, mix_hash={}", nonce, pow_hash, mix_hash); trace!(target: "miner", "submit_work: Decoded: nonce={}, pow_hash={}, mix_hash={}", nonce, pow_hash, mix_hash);
let miner = take_weak!(self.miner); let miner = take_weak!(self.miner);
let client = take_weak!(self.client); let client = take_weak!(self.client);
let seal = vec![encode(&mix_hash).to_vec(), encode(&nonce).to_vec()]; let seal = vec![encode(&mix_hash).to_vec(), encode(&nonce).to_vec()];