From b040aaa4348337b6cb7cc914f291208185ff1753 Mon Sep 17 00:00:00 2001 From: Gary Yu Date: Wed, 1 Aug 2018 00:35:57 +0800 Subject: [PATCH] Fix: old time crate use 0..11 as the month, make mistake when switching to chrono Utc.ymd (#1304) (#1305) --- chain/src/pipe.rs | 4 ++-- core/src/genesis.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index 66eb904b8..0d5864f3a 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -297,9 +297,9 @@ fn validate_header(header: &BlockHeader, ctx: &mut BlockContext) -> Result<(), E if target_difficulty != network_difficulty.clone() { error!( LOGGER, - "validate_header: BANNABLE OFFENCE: header cumulative difficulty {} != {}", + "validate_header: BANNABLE OFFENCE: header target difficulty {} != {}", target_difficulty.to_num(), - prev.total_difficulty.to_num() + network_difficulty.to_num() + network_difficulty.to_num() ); return Err(ErrorKind::WrongTotalDifficulty.into()); } diff --git a/core/src/genesis.rs b/core/src/genesis.rs index d6da60257..c935e8bc5 100644 --- a/core/src/genesis.rs +++ b/core/src/genesis.rs @@ -29,7 +29,7 @@ pub fn genesis_dev() -> core::Block { header: core::BlockHeader { height: 0, previous: core::hash::Hash([0xff; 32]), - timestamp: Utc.ymd(1997, 7, 4).and_hms(0, 0, 0), + timestamp: Utc.ymd(1997, 8, 4).and_hms(0, 0, 0), nonce: global::get_genesis_nonce(), ..Default::default() }, @@ -46,7 +46,7 @@ pub fn genesis_testnet1() -> core::Block { header: core::BlockHeader { height: 0, previous: core::hash::Hash([0xff; 32]), - timestamp: Utc.ymd(2017, 10, 16).and_hms(20, 0, 0), + timestamp: Utc.ymd(2017, 11, 16).and_hms(20, 0, 0), nonce: 28205, pow: core::Proof::new(vec![ 0x21e, 0x7a2, 0xeae, 0x144e, 0x1b1c, 0x1fbd, 0x203a, 0x214b, 0x293b, 0x2b74, @@ -69,7 +69,7 @@ pub fn genesis_testnet2() -> core::Block { header: core::BlockHeader { height: 0, previous: core::hash::Hash([0xff; 32]), - timestamp: Utc.ymd(2018, 2, 26).and_hms(16, 0, 0), + timestamp: Utc.ymd(2018, 3, 26).and_hms(16, 0, 0), total_difficulty: Difficulty::from_num(global::initial_block_difficulty()), nonce: 1060, pow: core::Proof::new(vec![ @@ -94,7 +94,7 @@ pub fn genesis_testnet3() -> core::Block { header: core::BlockHeader { height: 0, previous: core::hash::Hash([0xff; 32]), - timestamp: Utc.ymd(2018, 6, 8).and_hms(18, 0, 0), + timestamp: Utc.ymd(2018, 7, 8).and_hms(18, 0, 0), total_difficulty: Difficulty::from_num(global::initial_block_difficulty()), nonce: 4956988373127691, pow: core::Proof::new(vec![ @@ -121,7 +121,7 @@ pub fn genesis_main() -> core::Block { header: core::BlockHeader { height: 0, previous: core::hash::Hash([0xff; 32]), - timestamp: Utc.ymd(2018, 7, 14).and_hms(0, 0, 0), + timestamp: Utc.ymd(2018, 8, 14).and_hms(0, 0, 0), total_difficulty: Difficulty::from_num(global::initial_block_difficulty()), nonce: global::get_genesis_nonce(), pow: core::Proof::zero(consensus::PROOFSIZE),