mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
check_verified_properties(): Don't ignore fails of Peerstate::set_verified()
- Return Result from set_verified() so that it can't be missed. - Pass Fingerprint to set_verified() by value to avoid cloning it inside. This optimises out an extra clone() if we already have a value that can be moved at the caller side. However, this may add an extra clone() if set_verified() fails, but let's not optimise the fail scenario.
This commit is contained in:
@@ -2178,10 +2178,10 @@ async fn check_verified_properties(
|
||||
if let Some(fp) = fp {
|
||||
peerstate.set_verified(
|
||||
PeerstateKeyType::GossipKey,
|
||||
&fp,
|
||||
fp,
|
||||
PeerstateVerifiedStatus::BidirectVerified,
|
||||
contact.get_addr().to_owned(),
|
||||
);
|
||||
)?;
|
||||
peerstate.save_to_db(&context.sql).await?;
|
||||
is_verified = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user