Skip to content

Commit

Permalink
header version now explicit, no "default" version
Browse files Browse the repository at this point in the history
"empty" block can safely have verion 0 as it needs to be set later
  • Loading branch information
antiochp committed Nov 29, 2019
1 parent 82b1ff9 commit 10fcd47
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/src/core/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ impl Hashed for HeaderEntry {
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
pub struct HeaderVersion(pub u16);

impl Default for HeaderVersion {
fn default() -> HeaderVersion {
HeaderVersion(1)
}
}

// self-conscious increment function courtesy of Jasper
impl HeaderVersion {
fn next(&self) -> Self {
Expand Down Expand Up @@ -253,7 +247,7 @@ impl DefaultHashable for BlockHeader {}
impl Default for BlockHeader {
fn default() -> BlockHeader {
BlockHeader {
version: HeaderVersion::default(),
version: HeaderVersion::new(0),
height: 0,
timestamp: DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(0, 0), Utc),
prev_hash: ZERO_HASH,
Expand Down

0 comments on commit 10fcd47

Please sign in to comment.