mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Peer manager cfg (#2766)
## Issue Addressed I've done this change in a couple of WIPs already so I might as well submit it on its own. This changes no functionality but reduces coupling in a 0.0001%. It also helps new people who need to work in the peer manager to better understand what it actually needs from the outside ## Proposed Changes Add a config to the peer manager
This commit is contained in:
@@ -8,7 +8,7 @@ use lighthouse_network::{
|
||||
discv5::enr::{CombinedKey, EnrBuilder},
|
||||
rpc::methods::{MetaData, MetaDataV2},
|
||||
types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield, SyncState},
|
||||
ConnectedPoint, Enr, NetworkConfig, NetworkGlobals, PeerId, PeerManager,
|
||||
ConnectedPoint, Enr, NetworkGlobals, PeerId, PeerManager,
|
||||
};
|
||||
use network::NetworkMessage;
|
||||
use sensitive_url::SensitiveUrl;
|
||||
@@ -106,8 +106,8 @@ pub async fn create_api_server<T: BeaconChainTypes>(
|
||||
));
|
||||
|
||||
// Only a peer manager can add peers, so we create a dummy manager.
|
||||
let network_config = NetworkConfig::default();
|
||||
let mut pm = PeerManager::new(&network_config, network_globals.clone(), &log)
|
||||
let config = lighthouse_network::peer_manager::config::Config::default();
|
||||
let mut pm = PeerManager::new(config, network_globals.clone(), &log)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user