rkyv issue

This commit is contained in:
John Smith
2022-11-12 12:10:38 -05:00
parent baf1353fd2
commit 1c93b6e8cb
17 changed files with 86 additions and 196 deletions

View File

@@ -360,7 +360,6 @@ pub struct NodeId {
}
impl NodeId {
pub fn new(key: DHTKey) -> Self {
assert!(key.valid);
Self { key }
}
}
@@ -1967,7 +1966,7 @@ impl MatchesDialInfoFilter for DialInfo {
pub struct SignedDirectNodeInfo {
pub node_info: NodeInfo,
pub timestamp: u64,
pub signature: DHTSignature,
pub signature: Option<DHTSignature>,
}
impl SignedDirectNodeInfo {
@@ -1982,7 +1981,7 @@ impl SignedDirectNodeInfo {
Ok(Self {
node_info,
timestamp,
signature,
signature: Some(signature),
})
}
@@ -1997,7 +1996,7 @@ impl SignedDirectNodeInfo {
Ok(Self {
node_info,
timestamp,
signature,
signature: Some(signature),
})
}
@@ -2022,13 +2021,13 @@ impl SignedDirectNodeInfo {
pub fn with_no_signature(node_info: NodeInfo) -> Self {
Self {
node_info,
signature: DHTSignature::default(),
signature: None,
timestamp: intf::get_timestamp(),
}
}
pub fn has_valid_signature(&self) -> bool {
self.signature.valid
self.signature.is_some()
}
}