Merge pull request #5595 from paritytech/no-warp-if-disabled

only enable warp sync when engine supports it
This commit is contained in:
Robert Habermeier
2017-05-13 15:04:06 +02:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -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 }