From 69eac0a1e95f61d6ab361cd130fc6c0fe9b86de2 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 19 Dec 2016 12:55:28 +0100 Subject: [PATCH] Renamed history size field --- ethcore/src/client/client.rs | 2 +- ethcore/src/client/test_client.rs | 2 +- ethcore/src/types/pruning_info.rs | 4 ++-- sync/src/chain.rs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index f5cb2040e85..c023cbdfbef 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -1371,7 +1371,7 @@ impl BlockChainClient for Client { PruningInfo { earliest_chain: self.chain.read().first_block_number().unwrap_or(1), earliest_state: self.state_db.lock().journal_db().earliest_era().unwrap_or(0), - history_size: Some(self.history), + state_history_size: Some(self.history), } } diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index dca518a223c..b9a51babdd0 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -712,7 +712,7 @@ impl BlockChainClient for TestBlockChainClient { PruningInfo { earliest_chain: 1, earliest_state: 1, - history_size: *self.history.read(), + state_history_size: *self.history.read(), } } diff --git a/ethcore/src/types/pruning_info.rs b/ethcore/src/types/pruning_info.rs index e34280f0aec..44331686525 100644 --- a/ethcore/src/types/pruning_info.rs +++ b/ethcore/src/types/pruning_info.rs @@ -28,6 +28,6 @@ pub struct PruningInfo { pub earliest_chain: u64, /// The first block where state requests may be served. pub earliest_state: u64, - /// Pruning history size - pub history_size: Option, + /// State pruning history size. + pub state_history_size: Option, } diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 7672cea97ac..72b1cf5687a 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -380,7 +380,7 @@ impl ChainSync { peers: HashMap::new(), handshaking_peers: HashMap::new(), active_peers: HashSet::new(), - new_blocks: BlockDownloader::new(false, &chain_info.best_block_hash, chain_info.best_block_number, pruning.history_size), + new_blocks: BlockDownloader::new(false, &chain_info.best_block_hash, chain_info.best_block_number, pruning.state_history_size), old_blocks: None, last_sent_block_number: 0, network_id: config.network_id, @@ -565,13 +565,13 @@ impl ChainSync { // Do not assume that the block queue/chain still has our last_imported_block let pruning = chain.pruning_info(); let chain = chain.chain_info(); - self.new_blocks = BlockDownloader::new(false, &chain.best_block_hash, chain.best_block_number, pruning.history_size); + self.new_blocks = BlockDownloader::new(false, &chain.best_block_hash, chain.best_block_number, pruning.state_history_size); self.old_blocks = None; if self.download_old_blocks { if let (Some(ancient_block_hash), Some(ancient_block_number)) = (chain.ancient_block_hash, chain.ancient_block_number) { trace!(target: "sync", "Downloading old blocks from {:?} (#{}) till {:?} (#{:?})", ancient_block_hash, ancient_block_number, chain.first_block_hash, chain.first_block_number); - let mut downloader = BlockDownloader::new(true, &ancient_block_hash, ancient_block_number, pruning.history_size); + let mut downloader = BlockDownloader::new(true, &ancient_block_hash, ancient_block_number, pruning.state_history_size); if let Some(hash) = chain.first_block_hash { trace!(target: "sync", "Downloader target set to {:?}", hash); downloader.set_target(&hash);