Ensure that Peerstate has an address set on the type level

This commit is contained in:
Alexander Krotov
2019-11-30 20:40:24 +01:00
parent 72c29aca6a
commit d5359fb9ba
4 changed files with 36 additions and 53 deletions

View File

@@ -617,18 +617,18 @@ impl Contact {
.peek_key(PeerstateVerifiedStatus::Unverified)
.map(|k| k.formatted_fingerprint())
.unwrap_or_default();
if peerstate.addr.is_some() && &loginparam.addr < peerstate.addr.as_ref().unwrap() {
if loginparam.addr < peerstate.addr {
cat_fingerprint(&mut ret, &loginparam.addr, &fingerprint_self, "");
cat_fingerprint(
&mut ret,
peerstate.addr.as_ref().unwrap(),
peerstate.addr.clone(),
&fingerprint_other_verified,
&fingerprint_other_unverified,
);
} else {
cat_fingerprint(
&mut ret,
peerstate.addr.as_ref().unwrap(),
peerstate.addr.clone(),
&fingerprint_other_verified,
&fingerprint_other_unverified,
);