warning cleanup (#3759)

This commit is contained in:
Yeastplume
2024-01-29 09:23:38 +00:00
committed by GitHub
parent a9f45dee2b
commit d1b7ae5352
7 changed files with 45 additions and 16 deletions
+3 -2
View File
@@ -69,8 +69,9 @@ pub fn connect_and_monitor(
// check seeds first
connect_to_seeds_and_peers(peers.clone(), tx.clone(), seed_list, config);
let mut prev = chrono::Date::<Utc>::MIN_UTC.and_hms(0, 0, 0);
let mut prev_expire_check = chrono::Date::<Utc>::MIN_UTC.and_hms(0, 0, 0);
let mut prev = DateTime::<Utc>::MIN_UTC;
let mut prev_expire_check = DateTime::<Utc>::MIN_UTC;
let mut prev_ping = Utc::now();
let mut start_attempt = 0;
let mut connecting_history: HashMap<PeerAddr, DateTime<Utc>> = HashMap::new();
+5 -1
View File
@@ -168,7 +168,11 @@ fn build_block(
b.header.pow.nonce = thread_rng().gen();
b.header.pow.secondary_scaling = difficulty.secondary_scaling;
b.header.timestamp = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(now_sec, 0), Utc);
let ts = NaiveDateTime::from_timestamp_opt(now_sec, 0);
if ts.is_none() {
return Err(Error::General("Utc::now into timestamp".into()));
}
b.header.timestamp = DateTime::<Utc>::from_utc(ts.unwrap(), Utc);
debug!(
"Built new block with {} inputs and {} outputs, block difficulty: {}, cumulative difficulty {}",