diff --git a/ethcore/src/basic_types.rs b/ethcore/src/basic_types.rs index 5c0100de3..79f009fd1 100644 --- a/ethcore/src/basic_types.rs +++ b/ethcore/src/basic_types.rs @@ -25,12 +25,10 @@ pub type LogBloom = H2048; pub static ZERO_LOGBLOOM: LogBloom = H2048([0x00; 256]); #[cfg_attr(feature="dev", allow(enum_variant_names))] -/// Enum for when a seal/signature is included. +/// Semantic boolean for when a seal/signature is included. pub enum Seal { /// The seal/signature is included. With, /// The seal/signature is not included. Without, - /// First N fields of seal are included. - WithSome(usize), } diff --git a/ethcore/src/header.rs b/ethcore/src/header.rs index 0aea4efd7..228933570 100644 --- a/ethcore/src/header.rs +++ b/ethcore/src/header.rs @@ -228,8 +228,7 @@ impl Header { // TODO: make these functions traity /// Place this header into an RLP stream `s`, optionally `with_seal`. pub fn stream_rlp(&self, s: &mut RlpStream, with_seal: Seal) { - let seal_n = match with_seal { Seal::With => self.seal.len(), Seal::WithSome(n) => n, _ => 0 }; - s.begin_list(13 + seal_n); + s.begin_list(13 + match with_seal { Seal::With => self.seal.len(), _ => 0 }); s.append(&self.parent_hash); s.append(&self.uncles_hash); s.append(&self.author); @@ -243,8 +242,10 @@ impl Header { s.append(&self.gas_used); s.append(&self.timestamp); s.append(&self.extra_data); - for b in self.seal.iter().take(seal_n) { - s.append_raw(b, 1); + if let Seal::With = with_seal { + for b in &self.seal { + s.append_raw(b, 1); + } } }