File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 6767//! # }
6868//! ```
6969
70+ use primitives:: Block ;
7071use units:: { BlockHeight , BlockInterval } ;
7172
7273use crate :: network:: Network ;
@@ -254,11 +255,11 @@ impl Params {
254255 pub const CPUNET : Params = Params {
255256 network : Network :: CPUNet ,
256257 bip16_time : 1333238400 , // Apr 1 2012
257- bip34_height : 1 ,
258- bip65_height : 1 ,
259- bip66_height : 1 ,
260- rule_change_activation_threshold : 1512 , // 75%
261- miner_confirmation_window : 2016 ,
258+ bip34_height : BlockHeight :: from_u32 ( 1 ) ,
259+ bip65_height : BlockHeight :: from_u32 ( 1 ) ,
260+ bip66_height : BlockHeight :: from_u32 ( 1 ) ,
261+ rule_change_activation_threshold : BlockInterval :: from_u32 ( 1512 ) , // 75%
262+ miner_confirmation_window : BlockInterval :: from_u32 ( 2016 ) ,
262263 pow_limit : Target :: MAX_ATTAINABLE_MAINNET ,
263264 max_attainable_target : Target :: MAX_ATTAINABLE_MAINNET ,
264265 pow_target_spacing : 10 * 60 , // 10 minutes.
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ impl Header {
196196 // This is the same as `Encodable` but done manually because `Encodable` isn't in `primitives`.
197197 pub fn block_hash ( & self ) -> BlockHash {
198198 let mut engine = sha256d:: Hash :: engine ( ) ;
199+ engine. input ( "cpunet\0 " . as_bytes ( ) ) ;
199200 engine. input ( & self . version . to_consensus ( ) . to_le_bytes ( ) ) ;
200201 engine. input ( self . prev_blockhash . as_byte_array ( ) ) ;
201202 engine. input ( self . merkle_root . as_byte_array ( ) ) ;
You can’t perform that action at this time.
0 commit comments