Fingerprint new client identify agent string (#2027)

Nimbus have modified their identify agent string. 

This PR adds their new agent string to identify new nimbus peers.
This commit is contained in:
Age Manning 2020-12-03 22:07:14 +00:00
parent 686b605112
commit 2682f46025

View File

@ -174,6 +174,20 @@ fn client_from_agent_version(agent_version: &str) -> (ClientKind, String, String
}
(kind, version, os_version)
}
Some("nimbus") => {
let kind = ClientKind::Nimbus;
let mut version = String::from("unknown");
let mut os_version = version.clone();
if agent_split.next().is_some() {
if let Some(agent_version) = agent_split.next() {
version = agent_version.into();
if let Some(agent_os_version) = agent_split.next() {
os_version = agent_os_version.into();
}
}
}
(kind, version, os_version)
}
Some("nim-libp2p") => {
let kind = ClientKind::Nimbus;
let mut version = String::from("unknown");