parity compiling fine

This commit is contained in:
debris
2016-02-19 00:50:23 +01:00
parent df3d17789a
commit 19a3daf533
5 changed files with 13 additions and 31 deletions

View File

@@ -17,7 +17,7 @@
#![warn(missing_docs)]
#![cfg_attr(feature="dev", feature(plugin))]
#![cfg_attr(feature="dev", plugin(clippy))]
#![feature(augmented_assignments)]
//#![feature(augmented_assignments)]
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
#![allow(clone_on_copy)]
@@ -59,7 +59,7 @@ use std::ops::*;
use std::sync::*;
use ethcore::client::Client;
use util::network::{NetworkProtocolHandler, NetworkService, NetworkContext, PeerId};
use util::io::TimerToken;
use util::TimerToken;
use chain::ChainSync;
use ethcore::service::SyncMessage;
use io::NetSyncIo;

View File

@@ -213,7 +213,10 @@ impl BlockChainClient for TestBlockChainClient {
}
let len = self.numbers.read().unwrap().len();
if number == len {
*self.difficulty.write().unwrap().deref_mut() += header.difficulty;
{
let mut difficulty = self.difficulty.write().unwrap();
*difficulty.deref_mut() = *difficulty.deref() + header.difficulty;
}
mem::replace(self.last_hash.write().unwrap().deref_mut(), h.clone());
self.blocks.write().unwrap().insert(h.clone(), b);
self.numbers.write().unwrap().insert(number, h.clone());