2 tiny modification on snapshot (#8601)

* Some tiny modifications.
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`

* Remove the clone of code_cache, as it has been done in clone_basic.

* remove From::from. It seems not necessary.

* change mode: remove rust files' executable mode.

* 2 tiny modifications on snapshot.
This commit is contained in:
lihuafeng 2018-05-13 04:46:08 +08:00 committed by Niklas Adolfsson
parent 57d1f2b4d3
commit 979af3d314
2 changed files with 2 additions and 2 deletions

View File

@ -229,7 +229,7 @@ impl Rebuilder for PowRebuilder {
let item_count = rlp.item_count()?; let item_count = rlp.item_count()?;
let num_blocks = (item_count - 3) as u64; let num_blocks = (item_count - 3) as u64;
trace!(target: "snapshot", "restoring block chunk with {} blocks.", item_count - 3); trace!(target: "snapshot", "restoring block chunk with {} blocks.", num_blocks);
if self.fed_blocks + num_blocks > self.snapshot_blocks { if self.fed_blocks + num_blocks > self.snapshot_blocks {
return Err(Error::TooManyBlocks(self.snapshot_blocks, self.fed_blocks + num_blocks).into()) return Err(Error::TooManyBlocks(self.snapshot_blocks, self.fed_blocks + num_blocks).into())

View File

@ -176,7 +176,7 @@ impl Restoration {
// verify final state root. // verify final state root.
let root = self.state.state_root(); let root = self.state.state_root();
if root != self.final_state_root { if root != self.final_state_root {
warn!("Final restored state has wrong state root: expected {:?}, got {:?}", root, self.final_state_root); warn!("Final restored state has wrong state root: expected {:?}, got {:?}", self.final_state_root, root);
return Err(TrieError::InvalidStateRoot(root).into()); return Err(TrieError::InvalidStateRoot(root).into());
} }