Skip to content

Commit 2b212d4

Browse files
author
pythcoiner
committed
get genesis timestamp from bitcoind
1 parent 3fcbb0b commit 2b212d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commands/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -888,13 +888,15 @@ impl DaemonControl {
888888
/// The date must be after the genesis block time and before the current tip blocktime.
889889
pub fn start_rescan(&self, timestamp: u32) -> Result<(), CommandError> {
890890
let mut db_conn = self.db.connection();
891+
let genesis_timestamp = self.bitcoin.genesis_block().height as u32;
892+
891893

892894
let future_timestamp = self
893895
.bitcoin
894896
.tip_time()
895897
.map(|t| timestamp >= t)
896898
.unwrap_or(false);
897-
if timestamp < MAINNET_GENESIS_TIME || future_timestamp {
899+
if timestamp < genesis_timestamp || future_timestamp {
898900
return Err(CommandError::InsaneRescanTimestamp(timestamp));
899901
}
900902
if db_conn.rescan_timestamp().is_some() || self.bitcoin.rescan_progress().is_some() {

0 commit comments

Comments
 (0)