handle last peer error case [CI SKIP]

This commit is contained in:
shimunn
2019-04-03 14:07:28 +02:00
parent 88b68a1de9
commit 6a13b27c19
2 changed files with 18 additions and 4 deletions

View File

@@ -194,6 +194,10 @@ impl PeerBuilder {
self.validate().is_ok()
}
pub fn has_key(&self) -> bool {
self.key.is_some()
}
pub fn add_allowed_ip(&mut self, ip: (IpAddr, u8)) {
if let Some(ref mut ips) = &mut self.allowed_ips {
ips.push(ip);