Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Renamed history size field
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar committed Dec 21, 2016
1 parent d1e0a2c commit 69eac0a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/client/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions ethcore/src/types/pruning_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>,
/// State pruning history size.
pub state_history_size: Option<u64>,
}
6 changes: 3 additions & 3 deletions sync/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 69eac0a

Please sign in to comment.