rebase fixes and address style concern

This commit is contained in:
Robert Habermeier 2016-05-26 13:26:07 +02:00
parent 7ee23240f0
commit e7791c220a

View File

@ -121,11 +121,9 @@ impl MinerService for TestMinerService {
// lets assume that all txs are valid
self.imported_transactions.lock().unwrap().extend_from_slice(&transactions);
for transaction in &transactions {
if let Ok(ref sender) = transaction.sender() {
let nonce = self.last_nonce(sender).unwrap_or(fetch_account(sender).nonce);
self.last_nonces.write().unwrap().insert(sender.clone(), nonce + U256::from(1));
}
for sender in transactions.iter().filter_map(|t| t.sender().ok()) {
let nonce = self.last_nonce(&sender).unwrap_or(fetch_account(&sender).nonce);
self.last_nonces.write().unwrap().insert(sender, nonce + U256::from(1));
}
transactions
.iter()