diff --git a/core/src/core/block.rs b/core/src/core/block.rs index b83a90026..c99a45039 100644 --- a/core/src/core/block.rs +++ b/core/src/core/block.rs @@ -185,13 +185,6 @@ impl Default for HeaderVersion { } } -// self-conscious increment function courtesy of Jasper -impl HeaderVersion { - fn next(&self) -> Self { - Self(self.0 + 1) - } -} - impl HeaderVersion { /// Constructor taking the provided version. pub fn new(version: u16) -> HeaderVersion { @@ -619,12 +612,9 @@ impl Block { vec![], )?; + // Determine the height and associated version for the new header. let height = prev.height + 1; - - let mut version = prev.version; - if !consensus::valid_header_version(height, version) { - version = version.next(); - } + let version = consensus::header_version(height); let now = Utc::now().timestamp(); let timestamp = DateTime::::from_utc(NaiveDateTime::from_timestamp(now, 0), Utc);