mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
net: change unwrap() to expect() on hostlist queries
This commit is contained in:
@@ -291,7 +291,10 @@ impl Hosts {
|
||||
debug!(target: "store::greylist_store_or_update()",
|
||||
"We have this entry in the greylist. Updating last seen...");
|
||||
|
||||
let index = self.get_greylist_index_at_addr(addr.clone()).await.unwrap();
|
||||
let index = self
|
||||
.get_greylist_index_at_addr(addr.clone())
|
||||
.await
|
||||
.expect("Expected greylist entry to exist");
|
||||
self.greylist_update_last_seen(&addr, last_seen, index).await;
|
||||
}
|
||||
}
|
||||
@@ -315,7 +318,10 @@ impl Hosts {
|
||||
debug!(target: "store::whitelist_store_or_update()",
|
||||
"We have this entry in the whitelist. Updating last seen...");
|
||||
|
||||
let index = self.get_whitelist_index_at_addr(addr.clone()).await.unwrap();
|
||||
let index = self
|
||||
.get_whitelist_index_at_addr(addr.clone())
|
||||
.await
|
||||
.expect("Expected whitelist entry to exist");
|
||||
self.whitelist_update_last_seen(addr, last_seen.clone(), index).await;
|
||||
}
|
||||
}
|
||||
@@ -338,7 +344,10 @@ impl Hosts {
|
||||
debug!(target: "store::anchorlist_store_or_update()",
|
||||
"We have this entry in the anchorlist. Updating last seen...");
|
||||
|
||||
let index = self.get_anchorlist_index_at_addr(addr.clone()).await.unwrap();
|
||||
let index = self
|
||||
.get_anchorlist_index_at_addr(addr.clone())
|
||||
.await
|
||||
.expect("Expected anchorlist entry to exist");
|
||||
self.anchorlist_update_last_seen(addr, last_seen.clone(), index).await;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ use std::{
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use log::{debug};
|
||||
use log::debug;
|
||||
use smol::Executor;
|
||||
|
||||
use super::{channel::ChannelPtr, p2p::P2pPtr, protocol::ProtocolVersion};
|
||||
|
||||
Reference in New Issue
Block a user