Skip to content

Commit

Permalink
Merge pull request openethereum#5595 from paritytech/no-warp-if-disabled
Browse files Browse the repository at this point in the history
only enable warp sync when engine supports it
  • Loading branch information
rphmeier authored May 13, 2017
2 parents b1f6112 + 56768ff commit 4df1772
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ethcore/src/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ pub trait Engine : Sync + Send {
None
}

/// Whether this engine supports warp sync.
fn supports_warp(&self) -> bool {
self.snapshot_components().is_some()
}

/// Returns new contract address generation scheme at given block number.
fn create_address_scheme(&self, number: BlockNumber) -> CreateContractAddress {
if number >= self.params().eip86_transition { CreateContractAddress::FromCodeHash } else { CreateContractAddress::FromSenderAndNonce }
Expand Down
3 changes: 2 additions & 1 deletion parity/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,9 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> R
} else {
sync_config.subprotocol_name.clone_from_slice(spec.subprotocol_name().as_bytes());
}

sync_config.fork_block = spec.fork_block();
sync_config.warp_sync = cmd.warp_sync;
sync_config.warp_sync = spec.engine.supports_warp() && cmd.warp_sync;
sync_config.download_old_blocks = cmd.download_old_blocks;
sync_config.serve_light = cmd.serve_light;

Expand Down

0 comments on commit 4df1772

Please sign in to comment.