Correct chain initialization at genesis

This commit is contained in:
Ignotus Peverell 2018-03-26 17:38:27 +01:00
parent 74674c2307
commit 16beeca8c9
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211
2 changed files with 4 additions and 6 deletions

View file

@ -176,7 +176,7 @@ impl Chain {
let head = match head { let head = match head {
Ok(h) => h, Ok(h) => h,
Err(NotFoundErr) => { Err(NotFoundErr) => {
let tip = Tip::new(genesis.hash()); let tip = Tip::from_block(&genesis.header);
store.save_block(&genesis)?; store.save_block(&genesis)?;
store.setup_height(&genesis.header, &tip)?; store.setup_height(&genesis.header, &tip)?;
if genesis.kernels.len() > 0 { if genesis.kernels.len() > 0 {

View file

@ -89,17 +89,15 @@ pub fn genesis_testnet2() -> core::Block {
tm_hour: 16, tm_hour: 16,
..time::empty_tm() ..time::empty_tm()
}, },
//TODO: Check this is over-estimated at T2 launch
total_difficulty: Difficulty::from_num(global::initial_block_difficulty()), total_difficulty: Difficulty::from_num(global::initial_block_difficulty()),
nonce: 1060, nonce: 1060,
pow: core::Proof::new(vec![ pow: core::Proof::new(vec![
0x1940730, 0x333b9d0, 0x4739d6f, 0x4c6cfb1, 0x6e3d6c3, 0x74408a3, 0x7ba2bd2, 0x1940730, 0x333b9d0, 0x4739d6f, 0x4c6cfb1, 0x6e3d6c3, 0x74408a3, 0x7ba2bd2,
0x83e2024, 0x8ca22b5, 0x9d39ab8, 0xb6646dd, 0xc6698b6, 0xc6f78fe, 0xc99b662, 0x83e2024, 0x8ca22b5, 0x9d39ab8, 0xb6646dd, 0xc6698b6, 0xc6f78fe, 0xc99b662,
0xcf2ae8c, 0xcf41eed, 0xdd073e6, 0xded6af8, 0xf08d1a5, 0x1156a144, 0x11d1160a, 0xcf2ae8c, 0xcf41eed, 0xdd073e6, 0xded6af8, 0xf08d1a5, 0x1156a144, 0x11d1160a,
0x131bb0a5, 0x137ad703, 0x13b0831f, 0x1421683f, 0x147e3c1f, 0x1496fda0, 0x131bb0a5, 0x137ad703, 0x13b0831f, 0x1421683f, 0x147e3c1f, 0x1496fda0, 0x150ba22b,
0x150ba22b, 0x15cc5bc6, 0x16edf697, 0x17ced40c, 0x17d84f9e, 0x18a515c1, 0x15cc5bc6, 0x16edf697, 0x17ced40c, 0x17d84f9e, 0x18a515c1, 0x19320d9c, 0x19da4f6d,
0x19320d9c, 0x19da4f6d, 0x1b50bcb1, 0x1b8bc72f, 0x1c7b6964, 0x1d07b3a9, 0x1b50bcb1, 0x1b8bc72f, 0x1c7b6964, 0x1d07b3a9, 0x1d189d4d, 0x1d1f9a15, 0x1dafcd41,
0x1d189d4d, 0x1d1f9a15, 0x1dafcd41,
]), ]),
..Default::default() ..Default::default()
}, },