diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index 3877ff0c8260..ea6f6a4aa9ff 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -169,7 +169,7 @@ impl From for PublishConfig { match authenticity { MessageAuthenticity::Signed(keypair) => { let public_key = keypair.public(); - let key_enc = public_key.clone().to_protobuf_encoding(); + let key_enc = public_key.to_protobuf_encoding(); let key = if key_enc.len() <= 42 { // The public key can be inlined in [`rpc_proto::Message::from`], so we don't include it // specifically in the [`rpc_proto::Message::key`] field. diff --git a/protocols/gossipsub/src/protocol.rs b/protocols/gossipsub/src/protocol.rs index f4a88f5b8340..19293f58d7e4 100644 --- a/protocols/gossipsub/src/protocol.rs +++ b/protocols/gossipsub/src/protocol.rs @@ -228,7 +228,7 @@ impl GossipsubCodec { }; // The key must match the peer_id - if source != public_key.clone().to_peer_id() { + if source != public_key.to_peer_id() { warn!("Signature verification failed: Public key doesn't match source peer id"); return false; }