Skip to content

Commit

Permalink
lint and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
drHuangMHT committed Jan 11, 2025
1 parent 59151b6 commit 9b6a139
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions protocols/identify/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,12 @@ impl TryFrom<proto::Identify> for Info {
.signedPeerRecord
.and_then(|b| SignedEnvelope::from_protobuf_encoding(b.as_ref()).ok());

// When signedPeerRecord contains valid addresses, ignore addresses in listenAddrs.
// When signedPeerRecord is invalid or signed by others, ignore the signedPeerRecord(set to `None`).
// When signedPeerRecord contains valid addresses, ignore addresses in listenAddrs.
// When signedPeerRecord is invalid or signed by others, ignore the signedPeerRecord(set to
// `None`).
let (signed_peer_record, listen_addrs) = signed_peer_record
.as_ref()
.and_then(|envelope| PeerRecord::try_deserialize_signed_envelope(&envelope).ok())
.and_then(|envelope| PeerRecord::try_deserialize_signed_envelope(envelope).ok())
.and_then(|(envelope_public_key, _, _, addresses)| {
(*envelope_public_key == public_key).then_some(addresses)
})
Expand Down

0 comments on commit 9b6a139

Please sign in to comment.