mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Merge remote-tracking branch 'origin/release-v7.0.0' into unstable
This commit is contained in:
@@ -1475,6 +1475,21 @@ impl<E: EthSpec> Network<E> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds the given `enr` to the trusted peers mapping and tries to dial it
|
||||
/// every heartbeat to maintain the connection.
|
||||
pub fn dial_trusted_peer(&mut self, enr: Enr) {
|
||||
self.peer_manager_mut().add_trusted_peer(enr.clone());
|
||||
self.peer_manager_mut().dial_peer(enr);
|
||||
}
|
||||
|
||||
/// Remove the given peer from the trusted peers mapping if it exists and disconnect
|
||||
/// from it.
|
||||
pub fn remove_trusted_peer(&mut self, enr: Enr) {
|
||||
self.peer_manager_mut().remove_trusted_peer(enr.clone());
|
||||
self.peer_manager_mut()
|
||||
.disconnect_peer(enr.peer_id(), GoodbyeReason::TooManyPeers);
|
||||
}
|
||||
|
||||
/* Sub-behaviour event handling functions */
|
||||
|
||||
/// Handle a gossipsub event.
|
||||
|
||||
Reference in New Issue
Block a user