Skip to content
Snippets Groups Projects
Commit 43b80e63 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

remove ref to genesis timestamp

parent 2dafc7ac
No related branches found
No related tags found
No related merge requests found
......@@ -89,12 +89,6 @@ struct Smith {
certs_received: Vec<String>,
}
// Timestamp to block number
// fn to_bn(genesis_timestamp: u64, timestamp: u64) -> u32 {
// let duration_in_secs = timestamp.saturating_sub(genesis_timestamp);
// (duration_in_secs / 6) as u32
// }
// copied from duniter primitives
fn validate_idty_name(idty_name: &str) -> bool {
idty_name.len() >= 3
......@@ -117,21 +111,6 @@ pub fn build_genesis(
) -> Result<GenesisConfig, String> {
// preparatory steps
// define genesis timestamp
let genesis_timestamp: u64 =
if let Ok(genesis_timestamp) = std::env::var("DUNITER_GENESIS_TIMESTAMP") {
genesis_timestamp
.parse()
.map_err(|_| "DUNITER_GENESIS_TIMESTAMP must be a number".to_owned())?
} else {
use std::time::SystemTime;
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.expect("SystemTime before UNIX EPOCH!")
.as_secs()
};
log::info!("genesis timestamp: {}", genesis_timestamp);
// declare variables for building genesis
// -------------------------------------
// track if fatal error occured, but let processing continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment