Commit 435605a pythcoiner
committed
1 parent 3fcbb0b commit 435605a Copy full SHA for 435605a
File tree 1 file changed +2
-4
lines changed
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,6 @@ use miniscript::{
33
33
} ;
34
34
use serde:: { Deserialize , Serialize } ;
35
35
36
- // Timestamp in the header of the genesis block. Used for sanity checks.
37
- const MAINNET_GENESIS_TIME : u32 = 1231006505 ;
38
-
39
36
#[ derive( Debug , Clone , PartialEq , Eq ) ]
40
37
pub enum CommandError {
41
38
NoOutpointForSelfSend ,
@@ -888,13 +885,14 @@ impl DaemonControl {
888
885
/// The date must be after the genesis block time and before the current tip blocktime.
889
886
pub fn start_rescan ( & self , timestamp : u32 ) -> Result < ( ) , CommandError > {
890
887
let mut db_conn = self . db . connection ( ) ;
888
+ let genesis_timestamp = self . bitcoin . genesis_block ( ) . height as u32 ;
891
889
892
890
let future_timestamp = self
893
891
. bitcoin
894
892
. tip_time ( )
895
893
. map ( |t| timestamp >= t)
896
894
. unwrap_or ( false ) ;
897
- if timestamp < MAINNET_GENESIS_TIME || future_timestamp {
895
+ if timestamp < genesis_timestamp || future_timestamp {
898
896
return Err ( CommandError :: InsaneRescanTimestamp ( timestamp) ) ;
899
897
}
900
898
if db_conn. rescan_timestamp ( ) . is_some ( ) || self . bitcoin . rescan_progress ( ) . is_some ( ) {
You can’t perform that action at this time.
0 commit comments