only try to warp when engine supports it

This commit is contained in:
Robert Habermeier
2017-05-10 17:12:00 +02:00
parent 518b6e647b
commit 56768ff237
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 }