InstantSeal fix

This commit is contained in:
debris 2017-08-03 16:42:56 +02:00
parent 0c7c34e609
commit b0f9d73f6a
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ use util::Address;
use builtin::Builtin;
use engines::{Engine, Seal};
use spec::CommonParams;
use block::ExecutedBlock;
use block::{ExecutedBlock, IsBlock};
/// An engine which does not provide any consensus mechanism, just seals blocks internally.
pub struct InstantSeal {
@ -56,8 +56,8 @@ impl Engine for InstantSeal {
fn seals_internally(&self) -> Option<bool> { Some(true) }
fn generate_seal(&self, _block: &ExecutedBlock) -> Seal {
Seal::Regular(Vec::new())
fn generate_seal(&self, block: &ExecutedBlock) -> Seal {
if block.transactions().is_empty() { Seal::None } else { Seal::Regular(Vec::new()) }
}
}