Fix lock order

This commit is contained in:
arkpar 2016-06-20 23:48:47 +02:00
parent 7e424d2713
commit c912bb8c17

View File

@ -106,7 +106,8 @@ impl Miner {
#[cfg_attr(feature="dev", allow(cyclomatic_complexity))] #[cfg_attr(feature="dev", allow(cyclomatic_complexity))]
fn prepare_sealing(&self, chain: &MiningBlockChainClient) { fn prepare_sealing(&self, chain: &MiningBlockChainClient) {
trace!(target: "miner", "prepare_sealing: entering"); trace!(target: "miner", "prepare_sealing: entering");
let transactions = self.transaction_queue.lock().unwrap().top_transactions(); let mut queue = self.transaction_queue.lock().unwrap();
let transactions = queue.top_transactions();
let mut sealing_work = self.sealing_work.lock().unwrap(); let mut sealing_work = self.sealing_work.lock().unwrap();
let best_hash = chain.best_block_header().sha3(); let best_hash = chain.best_block_header().sha3();
@ -163,7 +164,6 @@ impl Miner {
let block = open_block.close(); let block = open_block.close();
let mut queue = self.transaction_queue.lock().unwrap();
let fetch_account = |a: &Address| AccountDetails { let fetch_account = |a: &Address| AccountDetails {
nonce: chain.latest_nonce(a), nonce: chain.latest_nonce(a),
balance: chain.latest_balance(a), balance: chain.latest_balance(a),