Add warning about secp256k1 network keys (#2764)

This commit is contained in:
Pierre Krieger
2019-06-03 14:48:46 +02:00
committed by Bastian Köcher
parent 8e0a14fe7a
commit 9904da17bb
@@ -16,6 +16,7 @@
use crate::{
behaviour::Behaviour,
config::NodeKeyConfig,
transport, NetworkState, NetworkStatePeer, NetworkStateNotConnectedPeer
};
use crate::custom_proto::{CustomProto, CustomProtoOut, CustomMessage, RegisteredProtocol};
@@ -79,6 +80,9 @@ where TMessage: CustomMessage + Send + 'static {
});
// Private and public keys configuration.
if let NodeKeyConfig::Secp256k1(_) = config.node_key {
warn!(target: "sub-libp2p", "Secp256k1 keys are deprecated in favour of ed25519");
}
let local_identity = config.node_key.clone().into_keypair()?;
let local_public = local_identity.public();
let local_peer_id = local_public.clone().into_peer_id();